Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 authored

Showing 1 changed file with 13 additions and 10 deletions. Show diff stats Hide diff stats

  1. 23  src/structure.cpp
23  src/structure.cpp
@@ -3687,21 +3687,24 @@ void structureUpdate(STRUCTURE *psBuilding, bool mission)
3687 3687
 		}
3688 3688
 	}
3689 3689
 
3690  
-	if (psBuilding->status == SS_BEING_BUILT && psBuilding->buildRate == 0 && !structureHasModules(psBuilding))
  3690
+	if (!mission)
3691 3691
 	{
3692  
-		if (psBuilding->pStructureType->powerToBuild == 0)
  3692
+		if (psBuilding->status == SS_BEING_BUILT && psBuilding->buildRate == 0 && !structureHasModules(psBuilding))
3693 3693
 		{
3694  
-			// Building is free, and not currently being built, so deconstruct slowly over 1 minute.
3695  
-			psBuilding->currentBuildPts -= std::min<int>(psBuilding->currentBuildPts, gameTimeAdjustedAverage(psBuilding->pStructureType->buildPoints, 60));
3696  
-		}
  3694
+			if (psBuilding->pStructureType->powerToBuild == 0)
  3695
+			{
  3696
+				// Building is free, and not currently being built, so deconstruct slowly over 1 minute.
  3697
+				psBuilding->currentBuildPts -= std::min<int>(psBuilding->currentBuildPts, gameTimeAdjustedAverage(psBuilding->pStructureType->buildPoints, 60));
  3698
+			}
3697 3699
 
3698  
-		if (psBuilding->currentBuildPts == 0)
3699  
-		{
3700  
-			removeStruct(psBuilding, true);  // If giving up on building something, remove the structure (and remove it from the power queue).
  3700
+			if (psBuilding->currentBuildPts == 0)
  3701
+			{
  3702
+				removeStruct(psBuilding, true);  // If giving up on building something, remove the structure (and remove it from the power queue).
  3703
+			}
3701 3704
 		}
  3705
+		psBuilding->lastBuildRate = psBuilding->buildRate;
  3706
+		psBuilding->buildRate = 0;  // Reset to 0, each truck building us will add to our buildRate.
3702 3707
 	}
3703  
-	psBuilding->lastBuildRate = psBuilding->buildRate;
3704  
-	psBuilding->buildRate = 0;  // Reset to 0, each truck building us will add to our buildRate.
3705 3708
 
3706 3709
 	/* Only add smoke if they're visible and they can 'burn' */
3707 3710
 	if (!mission && psBuilding->visible[selectedPlayer] && canSmoke(psBuilding))

0 notes on commit 594b8a6

Please sign in to comment.
Something went wrong with that request. Please try again.