mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
Fix bug if vehicle holds more soldiers than can fit in a squad (by Seven) (#103)
* Fix bug if vehicle holds more soldiers than can fit in a squad (by Seven) We would fail Assert(fSuccess) as all passengers would not fit in one squad, and the code wouldn't allow creating a new squad where they could be placed. * Add missing if conditional to previous fix My bad
This commit is contained in:
@@ -2141,6 +2141,15 @@ void PutNonSquadMercsInPlayerGroupOnSquads( GROUP *pGroup, BOOLEAN fExitVehicles
|
|||||||
// because if this is a simultaneous group attack, the mercs could be coming from different sides, and the
|
// because if this is a simultaneous group attack, the mercs could be coming from different sides, and the
|
||||||
// placement screen can't handle mercs on the same squad arriving from difference edges!
|
// placement screen can't handle mercs on the same squad arriving from difference edges!
|
||||||
fSuccess = AddCharacterToSquad( pSoldier, bUniqueVehicleSquad );
|
fSuccess = AddCharacterToSquad( pSoldier, bUniqueVehicleSquad );
|
||||||
|
// if we failed, create another squad
|
||||||
|
if (!fSuccess)
|
||||||
|
{
|
||||||
|
bUniqueVehicleSquad = GetFirstEmptySquad();
|
||||||
|
if (bUniqueVehicleSquad != -1)
|
||||||
|
{
|
||||||
|
fSuccess = AddCharacterToSquad(pSoldier, bUniqueVehicleSquad);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//CHRISL: So what's supposed to happen in the merc is assigned to a vehicle but fExitVehicles is FALSE?
|
//CHRISL: So what's supposed to happen in the merc is assigned to a vehicle but fExitVehicles is FALSE?
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user