2023-04-01 09:39 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003359Spring engineGeneralpublic2012-12-09 03:24
ReporterBeherith 
Assigned Toabma 
PrioritynormalSeveritytweakReproducibilityalways
StatusresolvedResolutionfixed 
Product Version91.0.1+git 
Target Version92.0Fixed in Version 
Summary0003359: [91.0.1-566] Commander wrecks dont drop to ground level.
DescriptionThe wrecks do not drop to the crater level after the commander dies. In 91 they did.
Steps To ReproduceBA 7.72, DSD:

/give 2 corcom
dgun each other

The wrecks are floating in midair.
Additional InformationThanks!
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • jpg file icon screen00221.jpg (367,166 bytes) 2012-12-04 16:15
  • diff file icon mantis3359-fix.diff (3,522 bytes) 2012-12-05 21:16 -
    diff --git a/rts/Sim/Features/Feature.cpp b/rts/Sim/Features/Feature.cpp
    index 79038f5..a6352fa 100644
    --- a/rts/Sim/Features/Feature.cpp
    +++ b/rts/Sim/Features/Feature.cpp
    @@ -31,6 +31,7 @@ CR_BIND_DERIVED(CFeature, CSolidObject, )
     CR_REG_METADATA(CFeature, (
     	CR_MEMBER(defID),
     	CR_MEMBER(isRepairingBeforeResurrect),
    +	CR_MEMBER(isAtFinalHeight),
     	CR_MEMBER(isMoving),
     	CR_MEMBER(inUpdateQue),
     	CR_MEMBER(resurrectProgress),
    @@ -52,6 +53,7 @@ CR_REG_METADATA(CFeature, (
     CFeature::CFeature() : CSolidObject(),
     	defID(-1),
     	isRepairingBeforeResurrect(false),
    +	isAtFinalHeight(false),
     	isMoving(false),
     	inUpdateQue(false),
     	resurrectProgress(0.0f),
    @@ -481,8 +483,6 @@ bool CFeature::UpdatePosition()
     				Move1D(realGroundHeight, 1, false);
     			}
     
    -			isMoving = (deathSpeed != ZeroVector);
    -
     			if (!pos.IsInBounds()) {
     				pos.ClampInBounds();
     
    @@ -516,15 +516,19 @@ bool CFeature::UpdatePosition()
     		}
     
     		transMatrix[13] = pos.y;
    -		isMoving = (std::fabs(pos.y - finalHeight) >= 0.01f);
     	}
     
     	isUnderWater = ((pos.y + height) < 0.0f);
    +	isMoving = ((deathSpeed != ZeroVector) || (std::fabs(pos.y - finalHeight) >= 0.01f));
    +
     	return isMoving;
     }
     
     void CFeature::UpdateFinalHeight(bool useGroundHeight)
     {
    +	if (isAtFinalHeight)
    +		return;
    +
     	if (useGroundHeight) {
     		if (def->floating) {
     			finalHeight = ground->GetHeightAboveWater(pos.x, pos.z);
    @@ -532,6 +536,10 @@ void CFeature::UpdateFinalHeight(bool useGroundHeight)
     			finalHeight = ground->GetHeightReal(pos.x, pos.z);
     		}
     	} else {
    +		// permanently stay at this height,
    +		// even if terrain changes under us
    +		// later
    +		isAtFinalHeight = true;
     		finalHeight = pos.y;
     	}
     }
    diff --git a/rts/Sim/Features/Feature.h b/rts/Sim/Features/Feature.h
    index 788307a..2407e70 100644
    --- a/rts/Sim/Features/Feature.h
    +++ b/rts/Sim/Features/Feature.h
    @@ -89,6 +89,7 @@ public:
     	 * until the corpse has been fully 'repaired'.
     	 */
     	bool isRepairingBeforeResurrect;
    +	bool isAtFinalHeight;
     	bool isMoving;
     	bool inUpdateQue;
     
    diff --git a/rts/Sim/Features/FeatureHandler.cpp b/rts/Sim/Features/FeatureHandler.cpp
    index b0fdf5a..5b90ffd 100644
    --- a/rts/Sim/Features/FeatureHandler.cpp
    +++ b/rts/Sim/Features/FeatureHandler.cpp
    @@ -467,8 +467,10 @@ void CFeatureHandler::SetFeatureUpdateable(CFeature* feature)
     
     void CFeatureHandler::TerrainChanged(int x1, int y1, int x2, int y2)
     {
    -	const vector<int> &quads = qf->GetQuadsRectangle(float3(x1 * SQUARE_SIZE, 0, y1 * SQUARE_SIZE),
    -		float3(x2 * SQUARE_SIZE, 0, y2 * SQUARE_SIZE));
    +	const vector<int>& quads = qf->GetQuadsRectangle(
    +		float3(x1 * SQUARE_SIZE, 0, y1 * SQUARE_SIZE),
    +		float3(x2 * SQUARE_SIZE, 0, y2 * SQUARE_SIZE)
    +	);
     
     	for (vector<int>::const_iterator qi = quads.begin(); qi != quads.end(); ++qi) {
     		list<CFeature*>::const_iterator fi;
    @@ -476,21 +478,10 @@ void CFeatureHandler::TerrainChanged(int x1, int y1, int x2, int y2)
     
     		for (fi = features.begin(); fi != features.end(); ++fi) {
     			CFeature* feature = *fi;
    -			float3& fpos = feature->pos;
    -
    -			float gh = ground->GetHeightReal(fpos.x, fpos.z);
    -			float wh = gh;
    -
    -			if (feature->def->floating)
    -				wh = ground->GetHeightAboveWater(fpos.x, fpos.z);
    -
    -			if (fpos.y > wh || fpos.y < gh) {
    -				feature->finalHeight = wh;
    -				feature->isMoving = false;
    -
    -				// put this feature back in the update-queue
    -				SetFeatureUpdateable(feature);
    -			}
    +			feature->UpdateFinalHeight(true);
    +			// put this feature back in the update-queue
    +			SetFeatureUpdateable(feature);
     		}
     	}
     }
    +
    
    diff file icon mantis3359-fix.diff (3,522 bytes) 2012-12-05 21:16 +

-Relationships
+Relationships

-Notes

~0009450

cleanrock (reporter)

I noticed a few aicraft wrecks stuck mid-air yesterday, probably same bug.

~0009494

abma (administrator)

https://github.com/spring/spring/commit/b2e629cf987f41443d68fd0a50374790f6301d19
+Notes

-Issue History
Date Modified Username Field Change
2012-12-04 16:15 Beherith New Issue
2012-12-04 16:15 Beherith File Added: screen00221.jpg
2012-12-04 21:45 cleanrock Note Added: 0009450
2012-12-05 17:34 abma Product Version 91.0 => 91.0.1+git
2012-12-05 17:34 abma Target Version => 92.0
2012-12-05 21:16 Kloot File Added: mantis3359-fix.diff
2012-12-09 03:24 abma Note Added: 0009494
2012-12-09 03:24 abma Status new => resolved
2012-12-09 03:24 abma Resolution open => fixed
2012-12-09 03:24 abma Assigned To => abma
+Issue History