mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
Fix vehicles consuming fuel after instant movement cancel (#213)
This commit is contained in:
@@ -1951,33 +1951,33 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
|
|||||||
SectorInfo[SECTOR( pGroup->ubSectorX, pGroup->ubSectorY )].bLastKnownEnemies = NumNonPlayerTeamMembersInSector( pGroup->ubSectorX, pGroup->ubSectorY, ENEMY_TEAM );
|
SectorInfo[SECTOR( pGroup->ubSectorX, pGroup->ubSectorY )].bLastKnownEnemies = NumNonPlayerTeamMembersInSector( pGroup->ubSectorX, pGroup->ubSectorY, ENEMY_TEAM );
|
||||||
}
|
}
|
||||||
|
|
||||||
// award life 'experience' for travelling, based on travel time!
|
// Flugente: do not award experience gain if we never left
|
||||||
if ( !pGroup->fVehicle )
|
if (!fNeverLeft)
|
||||||
{
|
{
|
||||||
// Flugente: do not award experience gain if we never left
|
// award life 'experience' for travelling, based on travel time!
|
||||||
if ( !fNeverLeft )
|
if (!pGroup->fVehicle)
|
||||||
{
|
{
|
||||||
// gotta be walking to get tougher
|
// gotta be walking to get tougher
|
||||||
AwardExperienceForTravelling( pGroup );
|
AwardExperienceForTravelling(pGroup);
|
||||||
}
|
}
|
||||||
}
|
else if (!IsGroupTheHelicopterGroup(pGroup))
|
||||||
else if( !IsGroupTheHelicopterGroup( pGroup ) )
|
|
||||||
{
|
|
||||||
SOLDIERTYPE *pSoldier;
|
|
||||||
INT32 iVehicleID;
|
|
||||||
iVehicleID = GivenMvtGroupIdFindVehicleId( pGroup->ubGroupID );
|
|
||||||
AssertMsg( iVehicleID != -1, "GroupArrival for vehicle group. Invalid iVehicleID. " );
|
|
||||||
|
|
||||||
pSoldier = GetSoldierStructureForVehicle( iVehicleID );
|
|
||||||
AssertMsg( pSoldier, "GroupArrival for vehicle group. Invalid soldier pointer." );
|
|
||||||
|
|
||||||
SpendVehicleFuel( pSoldier, (INT16)(pGroup->uiTraverseTime*6) );
|
|
||||||
|
|
||||||
if( !VehicleFuelRemaining( pSoldier ) )
|
|
||||||
{
|
{
|
||||||
ReportVehicleOutOfGas( iVehicleID, pGroup->ubSectorX, pGroup->ubSectorY );
|
SOLDIERTYPE* pSoldier;
|
||||||
//Nuke the group's path, so they don't continue moving.
|
INT32 iVehicleID;
|
||||||
ClearMercPathsAndWaypointsForAllInGroup( pGroup );
|
iVehicleID = GivenMvtGroupIdFindVehicleId(pGroup->ubGroupID);
|
||||||
|
AssertMsg(iVehicleID != -1, "GroupArrival for vehicle group. Invalid iVehicleID. ");
|
||||||
|
|
||||||
|
pSoldier = GetSoldierStructureForVehicle(iVehicleID);
|
||||||
|
AssertMsg(pSoldier, "GroupArrival for vehicle group. Invalid soldier pointer.");
|
||||||
|
|
||||||
|
SpendVehicleFuel(pSoldier, (INT16)(pGroup->uiTraverseTime * 6));
|
||||||
|
|
||||||
|
if (!VehicleFuelRemaining(pSoldier))
|
||||||
|
{
|
||||||
|
ReportVehicleOutOfGas(iVehicleID, pGroup->ubSectorX, pGroup->ubSectorY);
|
||||||
|
//Nuke the group's path, so they don't continue moving.
|
||||||
|
ClearMercPathsAndWaypointsForAllInGroup(pGroup);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user