diff --git a/code/ryzom/server/src/entities_game_service/camera_animation_manager/position_or_entity_type_helper.cpp b/code/ryzom/server/src/entities_game_service/camera_animation_manager/position_or_entity_type_helper.cpp index cffbfb806..2fe68b899 100644 --- a/code/ryzom/server/src/entities_game_service/camera_animation_manager/position_or_entity_type_helper.cpp +++ b/code/ryzom/server/src/entities_game_service/camera_animation_manager/position_or_entity_type_helper.cpp @@ -25,19 +25,32 @@ #include "mission_manager/mission_parser.h" #include "egs_mirror.h" +#define POS_OR_ENTITY_PREVIOUS_POS_VALUE "_PreviousPos_" +#define POS_OR_ENTITY_RETURN_POS_VALUE "_ReturnPos_" + const TPositionOrEntity CPositionOrEntityHelper::Invalid = TPositionOrEntity(); TPositionOrEntity CPositionOrEntityHelper::fromString(const std::string& s) { + // If the string is empty it's a previous pos if (s.empty()) { - nlerror("TPositionOrentityHelper : empty position or entity given to parse"); - return TPositionOrEntity(); + return TPositionOrEntity(TPositionOrEntity::EPreviousPos); } std::string str = s; CMissionParser::removeBlanks(str); + // We already check if it's a special position or entity object + if (NLMISC::toLower(str) == POS_OR_ENTITY_PREVIOUS_POS_VALUE) + { + return TPositionOrEntity(TPositionOrEntity::EPreviousPos); + } + else if (NLMISC::toLower(str) == POS_OR_ENTITY_RETURN_POS_VALUE) + { + return TPositionOrEntity(TPositionOrEntity::EReturnPos); + } + std::vector resS; NLMISC::splitString(str, ";", resS); // If we don't have 3 components, it's an entity