Merge branch 'main' into npc-pathing

This commit is contained in:
Aaron Kimbre
2022-10-31 10:31:13 -05:00
31 changed files with 648 additions and 366 deletions

View File

@@ -266,7 +266,7 @@ void Level::ReadSceneObjectDataChunk(std::ifstream& file, Header& header) {
spawnInfo.respawnTime = std::stof(data->GetValueAsString());
} else if (data->GetValueType() == eLDFType::LDF_TYPE_U32) // Ints are in ms?
{
spawnInfo.respawnTime = std::stoi(data->GetValueAsString()) / 1000;
spawnInfo.respawnTime = std::stoul(data->GetValueAsString()) / 1000;
}
}
if (data->GetKey() == u"spawnsGroupOnSmash") {

View File

@@ -403,30 +403,42 @@ void Zone::LoadPath(std::ifstream& file) {
BinaryIO::BinaryRead(file, path.property.price);
BinaryIO::BinaryRead(file, path.property.rentalTime);
BinaryIO::BinaryRead(file, path.property.associatedZone);
uint8_t count1;
BinaryIO::BinaryRead(file, count1);
for (uint8_t i = 0; i < count1; ++i) {
uint16_t character;
BinaryIO::BinaryRead(file, character);
path.property.displayName.push_back(character);
if (path.pathVersion >= 5) {
uint8_t count1;
BinaryIO::BinaryRead(file, count1);
for (uint8_t i = 0; i < count1; ++i) {
uint16_t character;
BinaryIO::BinaryRead(file, character);
path.property.displayName.push_back(character);
}
uint32_t count2;
BinaryIO::BinaryRead(file, count2);
for (uint8_t i = 0; i < count2; ++i) {
uint16_t character;
BinaryIO::BinaryRead(file, character);
path.property.displayDesc.push_back(character);
}
}
uint32_t count2;
BinaryIO::BinaryRead(file, count2);
for (uint8_t i = 0; i < count2; ++i) {
uint16_t character;
BinaryIO::BinaryRead(file, character);
path.property.displayDesc.push_back(character);
if (path.pathVersion >= 6) {
int32_t unknown1;
BinaryIO::BinaryRead(file, unknown1);
}
if (path.pathVersion >= 7) {
BinaryIO::BinaryRead(file, path.property.cloneLimit);
BinaryIO::BinaryRead(file, path.property.repMultiplier);
BinaryIO::BinaryRead(file, path.property.rentalTimeUnit);
}
if (path.pathVersion >= 8) {
BinaryIO::BinaryRead(file, path.property.achievementRequired);
BinaryIO::BinaryRead(file, path.property.playerZoneCoords.x);
BinaryIO::BinaryRead(file, path.property.playerZoneCoords.y);
BinaryIO::BinaryRead(file, path.property.playerZoneCoords.z);
BinaryIO::BinaryRead(file, path.property.maxBuildHeight);
}
int32_t unknown1;
BinaryIO::BinaryRead(file, unknown1);
BinaryIO::BinaryRead(file, path.property.cloneLimit);
BinaryIO::BinaryRead(file, path.property.repMultiplier);
BinaryIO::BinaryRead(file, path.property.rentalTimeUnit);
BinaryIO::BinaryRead(file, path.property.achievementRequired);
BinaryIO::BinaryRead(file, path.property.playerZoneCoords.x);
BinaryIO::BinaryRead(file, path.property.playerZoneCoords.y);
BinaryIO::BinaryRead(file, path.property.playerZoneCoords.z);
BinaryIO::BinaryRead(file, path.property.maxBuildHeight);
} else if (path.pathType == PathType::Camera) {
uint8_t count;
BinaryIO::BinaryRead(file, count);