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 == "Me" ) return OBJECT_HUMAN;
|
||||||
if (value == "Tech" ) return OBJECT_TECH;
|
if (value == "Tech" ) return OBJECT_TECH;
|
||||||
if (value == "MissionController" ) return OBJECT_CONTROLLER;
|
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)
|
const std::string CLevelParserParam::FromObjectType(ObjectType value)
|
||||||
|
|
|
@ -123,7 +123,6 @@ public:
|
||||||
bool IsDefined();
|
bool IsDefined();
|
||||||
|
|
||||||
static const std::string FromObjectType(ObjectType value);
|
static const std::string FromObjectType(ObjectType value);
|
||||||
static ObjectType ToObjectType(std::string value);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ParseArray();
|
void ParseArray();
|
||||||
|
@ -133,6 +132,7 @@ private:
|
||||||
template<typename T> T Cast(std::string requestedType);
|
template<typename T> T Cast(std::string requestedType);
|
||||||
|
|
||||||
std::string ToPath(std::string path, const std::string defaultDir);
|
std::string ToPath(std::string path, const std::string defaultDir);
|
||||||
|
ObjectType ToObjectType(std::string value);
|
||||||
DriveType ToDriveType(std::string value);
|
DriveType ToDriveType(std::string value);
|
||||||
ToolType ToToolType(std::string value);
|
ToolType ToToolType(std::string value);
|
||||||
Gfx::WaterType ToWaterType(std::string value);
|
Gfx::WaterType ToWaterType(std::string value);
|
||||||
|
|
Loading…
Reference in New Issue