fixed crash in wesnothd

This commit is contained in:
Dave White 2004-06-04 02:57:00 +00:00
parent 1d76a328fb
commit 26ac82e7f6

View file

@ -1,6 +1,22 @@
#include "../game_events.hpp"
namespace game_events {
const std::string& get_variable_const(const std::string& str) { return str; }
//this is an 'identity' implementation of variables, that just returns the name
//of the variable itself. To be used in systems for which variables shouldn't be implemented
namespace {
std::map<std::string,std::string> variables;
}
namespace game_events {
const std::string& get_variable_const(const std::string& str)
{
const std::map<std::string,std::string>::const_iterator itor = variables.find(str);
if(itor != variables.end()) {
return itor->second;
} else {
variables[str] = "$" + str;
return get_variable_const(str);
}
}
}