Merge branch 'main' into moreMovementAi

This commit is contained in:
David Markowitz
2024-03-09 21:09:19 -08:00
5 changed files with 200 additions and 159 deletions

View File

@@ -453,18 +453,20 @@ void Zone::LoadPath(std::istream& file) {
std::string value;
BinaryIO::ReadString<uint8_t>(file, value, BinaryIO::ReadType::WideString);
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());
auto waypointCommand = WaypointCommandType::StringToWaypointCommandType(parameter);
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 LOG("Tried to load invalid waypoint command '%s'", parameter.c_str());
if (waypointCommand != eWaypointCommandType::INVALID) {
auto& command = waypoint.commands.emplace_back();
command.command = waypointCommand;
command.data = value;
} else LOG("Tried to load invalid waypoint command '%s'", parameter.c_str());
} else {
ldfConfig = LDFBaseData::DataFromString(parameter + "=" + value);
if (ldfConfig) waypoint.config.push_back(ldfConfig);
waypoint.config.emplace_back(LDFBaseData::DataFromString(parameter + "=" + value));
}
}
}

View File

@@ -14,15 +14,13 @@ namespace LUTriggers {
class Level;
enum class eWaypointCommandType : uint32_t;
struct WaypointCommand {
eWaypointCommandType command;
std::string data;
WaypointCommand(eWaypointCommandType command, std::string data){
this->command = command;
this->data = data;
}
};
struct SceneRef {
std::string filename;
uint32_t id;