respect try-parse

consolidate space trimming
This commit is contained in:
Aaron Kimbre
2023-08-20 00:13:01 -05:00
parent 2bb39f4fa5
commit 5612e57590
2 changed files with 10 additions and 10 deletions

View File

@@ -550,9 +550,10 @@ void Zone::LoadPath(std::istream& file) {
LDFBaseData* ldfConfig = nullptr;
if (path.pathType == PathType::Movement || path.pathType == PathType::Rail) {
// cause NetDevil puts spaces in things that don't need spaces
parameter.erase(std::remove_if(parameter.begin(), parameter.end(), isspace), parameter.end());
parameter.erase(std::remove_if(parameter.begin(), parameter.end(), ::isspace), parameter.end());
auto waypointCommand = WaypointCommandType::StringToWaypointCommandType(parameter);
if(waypointCommand != eWaypointCommandType::INVALID) waypoint.commands.push_back(WaypointCommand(waypointCommand, value));
if (waypointCommand == eWaypointCommandType::DELAY) value.erase(std::remove_if(value.begin(), value.end(), ::isspace), value.end());
if (waypointCommand != eWaypointCommandType::INVALID) waypoint.commands.push_back(WaypointCommand(waypointCommand, value));
else Game::logger->Log("Zone", "Tried to load invalid waypoint command '%s'", parameter.c_str());
} else {
ldfConfig = LDFBaseData::DataFromString(parameter + "=" + value);