2019-12-13 18:12 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000673Spring engineGeneralpublic2007-11-04 01:05
Reporterthor 
Assigned Totvo 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000673: planes getting extra health instead of crashing
DescriptionIn SVN 4694, when a plane should have been killed and begun its crashing sequence, it gets the health boost that crashing planes get, but the crashing sequence never starts. So basically instead of dying, the plane stays alive and gets its health back. This happens consistently in both nota and xta, but only if there is an airpad somewhere on the map that is a valid landing spot for that airplane.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • patch file icon crashing_fixed.patch (1,630 bytes) 2007-11-04 00:04 -
    Index: rts/Sim/MoveTypes/AirMoveType.cpp
    ===================================================================
    --- rts/Sim/MoveTypes/AirMoveType.cpp	(revision 4699)
    +++ rts/Sim/MoveTypes/AirMoveType.cpp	(working copy)
    @@ -397,7 +397,7 @@
     	if(aircraftState!=AIRCRAFT_LANDED && owner->unitDef->maxFuel>0)
     		owner->currentFuel = max (0.f, owner->currentFuel - (16.f/GAME_SPEED));
     
    -	if(!reservedPad && aircraftState==AIRCRAFT_FLYING && owner->health<owner->maxHealth*repairBelowHealth){
    +	if(!reservedPad && aircraftState==AIRCRAFT_FLYING && owner->health<owner->maxHealth*repairBelowHealth && !owner->crashing){
     		CAirBaseHandler::LandingPad* lp=airBaseHandler->FindAirBase(owner,owner->unitDef->minAirBasePower);
     		if(lp){
     			AddDeathDependence(lp);
    @@ -1038,7 +1038,7 @@
     
     void CAirMoveType::SetState(CAirMoveType::AircraftState state)
     {
    -	if(/*aircraftState==AIRCRAFT_CRASHING || */state==aircraftState)
    +	if(aircraftState==AIRCRAFT_CRASHING || state==aircraftState)
     		return;
     
     /*	if (state == AIRCRAFT_LANDING)
    Index: rts/Sim/Units/COB/CobInstance.cpp
    ===================================================================
    --- rts/Sim/Units/COB/CobInstance.cpp	(revision 4699)
    +++ rts/Sim/Units/COB/CobInstance.cpp	(working copy)
    @@ -1349,8 +1349,9 @@
     				if(!!param){
     					((CAirMoveType*)unit->moveType)->SetState(CAirMoveType::AIRCRAFT_CRASHING);
     				} else {
    +					unit->crashing=false;
    +					((CAirMoveType*)unit->moveType)->aircraftState=CAirMoveType::AIRCRAFT_TAKEOFF;
     					((CAirMoveType*)unit->moveType)->SetState(CAirMoveType::AIRCRAFT_FLYING);
    -					unit->crashing=false;
     				}
     			}
     			break;
    
    patch file icon crashing_fixed.patch (1,630 bytes) 2007-11-04 00:04 +

-Relationships
+Relationships

-Notes

~0001405

yuritch (reporter)

Last edited: 2007-11-04 00:07

Seems like this was caused by my patch (set/get CRASHING). I'll look into the airpad problem.
Edit: I found the problem. Here is the patch that fixes it. Now aircrafts won't abort crashing on their own if an airpad is available, but set CRASHING to 0 will still do it (as was intended).

~0001407

tvo (reporter)

Thank you both for the quick feedback & fix, I have committed the patch now.
+Notes

-Issue History
Date Modified Username Field Change
2007-11-03 20:20 thor New Issue
2007-11-03 22:40 yuritch Note Added: 0001405
2007-11-04 00:04 yuritch File Added: crashing_fixed.patch
2007-11-04 00:07 yuritch Note Edited: 0001405
2007-11-04 01:04 tvo Status new => assigned
2007-11-04 01:04 tvo Assigned To => tvo
2007-11-04 01:05 tvo Status assigned => resolved
2007-11-04 01:05 tvo Resolution open => fixed
2007-11-04 01:05 tvo Note Added: 0001407
+Issue History