Skip to content

Commit

Permalink
Fixed issue which caused rally point map layers to be saved incorrectly
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrettin committed Jan 6, 2019
1 parent 599b9aa commit 74a1e5b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -876,9 +876,9 @@ int WriteMapSetup(const char *mapSetup, CMap &map, int writeTerrain, bool is_mod
const int value = mf.Value;
//Wyrmgus start
// f->printf("SetTile(%3d, %d, %d, %d)\n", n, j, i, value);
f->printf("SetTileTerrain(\"%s\", %d, %d, %d, %lu)\n", mf.Terrain->Ident.c_str(), x, y, 0, map_layer->ID);
f->printf("SetTileTerrain(\"%s\", %d, %d, %d, %d)\n", mf.Terrain->Ident.c_str(), x, y, 0, map_layer->ID);
if (mf.OverlayTerrain) {
f->printf("SetTileTerrain(\"%s\", %d, %d, %d, %lu)\n", mf.OverlayTerrain->Ident.c_str(), x, y, value, map_layer->ID);
f->printf("SetTileTerrain(\"%s\", %d, %d, %d, %d)\n", mf.OverlayTerrain->Ident.c_str(), x, y, value, map_layer->ID);
}
//Wyrmgus end
}
Expand Down
4 changes: 2 additions & 2 deletions src/unit/unit_save.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,9 @@ void SaveUnit(const CUnit &unit, CFile &file)
file.printf(",\n \"individual-upgrade\", \"%s\", %d", upgrade->Ident.c_str(), unit.GetIndividualUpgrade(upgrade));
}
}
if (unit.RallyPointPos.x != -1 && unit.RallyPointPos.y != -1) {
if (unit.RallyPointPos.x != -1 && unit.RallyPointPos.y != -1 && unit.RallyPointMapLayer) {
file.printf(",\n \"rally-point\", %d, %d", unit.RallyPointPos.x, unit.RallyPointPos.y);
file.printf(",\n \"rally-point-map-layer\", %d, ", unit.RallyPointMapLayer);
file.printf(",\n \"rally-point-map-layer\", %d, ", unit.RallyPointMapLayer->ID);
}
if (unit.Character != nullptr && unit.CurrentAction() != UnitActionDie && !unit.Destroyed) {
if (!unit.Character->Custom) {
Expand Down

0 comments on commit 74a1e5b

Please sign in to comment.