Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't try to remove unfinished off-world structures.

Fixes constant assertion spam:
info [mapTile:434] mapTile: x value is too big (77,19) in 64x64
info [mapTile:434] Assert in Warzone: ../../src/map.h:434 (x < mapWidth + 1), last script event: 'N/A'
info [destroyObject:272] destroyObject: object not found in list
info [destroyObject:272] Assert in Warzone: ../../src/objmem.cpp:272 (psCurr != __null), last script event: 'N/A'

Somehow fixes ticket:3653.
  • Loading branch information...
commit 594b8a6c631b160fda06f9ffca4b9f227c97c3f8 1 parent 88c1a3c
@Cyp Cyp authored
Showing with 13 additions and 10 deletions.
  1. +13 −10 src/structure.cpp
View
23 src/structure.cpp
@@ -3687,21 +3687,24 @@ void structureUpdate(STRUCTURE *psBuilding, bool mission)
}
}
- if (psBuilding->status == SS_BEING_BUILT && psBuilding->buildRate == 0 && !structureHasModules(psBuilding))
+ if (!mission)
{
- if (psBuilding->pStructureType->powerToBuild == 0)
+ if (psBuilding->status == SS_BEING_BUILT && psBuilding->buildRate == 0 && !structureHasModules(psBuilding))
{
- // Building is free, and not currently being built, so deconstruct slowly over 1 minute.
- psBuilding->currentBuildPts -= std::min<int>(psBuilding->currentBuildPts, gameTimeAdjustedAverage(psBuilding->pStructureType->buildPoints, 60));
- }
+ if (psBuilding->pStructureType->powerToBuild == 0)
+ {
+ // Building is free, and not currently being built, so deconstruct slowly over 1 minute.
+ psBuilding->currentBuildPts -= std::min<int>(psBuilding->currentBuildPts, gameTimeAdjustedAverage(psBuilding->pStructureType->buildPoints, 60));
+ }
- if (psBuilding->currentBuildPts == 0)
- {
- removeStruct(psBuilding, true); // If giving up on building something, remove the structure (and remove it from the power queue).
+ if (psBuilding->currentBuildPts == 0)
+ {
+ removeStruct(psBuilding, true); // If giving up on building something, remove the structure (and remove it from the power queue).
+ }
}
+ psBuilding->lastBuildRate = psBuilding->buildRate;
+ psBuilding->buildRate = 0; // Reset to 0, each truck building us will add to our buildRate.
}
- psBuilding->lastBuildRate = psBuilding->buildRate;
- psBuilding->buildRate = 0; // Reset to 0, each truck building us will add to our buildRate.
/* Only add smoke if they're visible and they can 'burn' */
if (!mission && psBuilding->visible[selectedPlayer] && canSmoke(psBuilding))
Please sign in to comment.
Something went wrong with that request. Please try again.