Skip to content

Commit

Permalink
Fix: Call setAssemblyPoint with bCheck=false when loading saved struc…
Browse files Browse the repository at this point in the history
…tures

To ensure that the structure receives the assembly point location that was in the save.

(Issues could arise for saved games where structures existed beyond the scroll limits - for example, in a custom campaign where the map is gradually expanded in response to events.)
  • Loading branch information
past-due committed Apr 27, 2024
1 parent 7031186 commit f96ba15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6248,7 +6248,7 @@ static bool loadSaveStructure2(const char *pFileName)
if (ini.contains("Factory/assemblyPoint/pos"))
{
Position point = ini.vector3i("Factory/assemblyPoint/pos");
setAssemblyPoint(psFactory->psAssemblyPoint, point.x, point.y, player, true);
setAssemblyPoint(psFactory->psAssemblyPoint, point.x, point.y, player, false);
psFactory->psAssemblyPoint->selected = ini.value("Factory/assemblyPoint/selected", false).toBool();
}
if (ini.contains("Factory/assemblyPoint/number"))
Expand Down Expand Up @@ -6323,7 +6323,7 @@ static bool loadSaveStructure2(const char *pFileName)
if (ini.contains("Repair/deliveryPoint/pos"))
{
Position point = ini.vector3i("Repair/deliveryPoint/pos");
setAssemblyPoint(psRepair->psDeliveryPoint, point.x, point.y, player, true);
setAssemblyPoint(psRepair->psDeliveryPoint, point.x, point.y, player, false);
psRepair->psDeliveryPoint->selected = ini.value("Repair/deliveryPoint/selected", false).toBool();
}
break;
Expand Down

0 comments on commit f96ba15

Please sign in to comment.