Fixed crash when loading level with incorrect object type
parent
d3f808f66d
commit
dd8a324f9b
|
@ -530,7 +530,7 @@ ObjectType CLevelParserParam::ToObjectType(std::string value)
|
|||
if (value == "Me" ) return OBJECT_HUMAN;
|
||||
if (value == "Tech" ) return OBJECT_TECH;
|
||||
if (value == "MissionController" ) return OBJECT_CONTROLLER;
|
||||
return static_cast<ObjectType>(boost::lexical_cast<int>(value));
|
||||
return static_cast<ObjectType>(Cast<int>(value, "object"));
|
||||
}
|
||||
|
||||
const std::string CLevelParserParam::FromObjectType(ObjectType value)
|
||||
|
|
|
@ -123,7 +123,6 @@ public:
|
|||
bool IsDefined();
|
||||
|
||||
static const std::string FromObjectType(ObjectType value);
|
||||
static ObjectType ToObjectType(std::string value);
|
||||
|
||||
private:
|
||||
void ParseArray();
|
||||
|
@ -133,6 +132,7 @@ private:
|
|||
template<typename T> T Cast(std::string requestedType);
|
||||
|
||||
std::string ToPath(std::string path, const std::string defaultDir);
|
||||
ObjectType ToObjectType(std::string value);
|
||||
DriveType ToDriveType(std::string value);
|
||||
ToolType ToToolType(std::string value);
|
||||
Gfx::WaterType ToWaterType(std::string value);
|
||||
|
|
Loading…
Reference in New Issue