mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
fixed some crashes when loading 4xx built savegames. The game can continue, but You'll probably loose your vehicles. The Team in the Laptop/Personel also consist only of Your AVATAR, but in strategic map the team is complete.
This is not a very well finished fix. Only glued some NULL assigned pointers. I recomend to NOT load too old savegames. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@733 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1890,7 +1890,18 @@ PathStPtr GetSoldierMercPathPtr( SOLDIERTYPE *pSoldier )
|
||||
// IS a vehicle?
|
||||
else if( pSoldier->uiStatusFlags & SOLDIER_VEHICLE )
|
||||
{
|
||||
pMercPath = pVehicleList[ pSoldier->bVehicleID ].pMercPath;
|
||||
/* Sergeant_Kolja, 2007-02-20: got an pVehicleList==NULL Exception on loading an older save here... not REALY fixed! */
|
||||
if( !pVehicleList ) /*bcause we have no vehicle list at all, we act as we are a person*/
|
||||
{
|
||||
pSoldier->uiStatusFlags &= ~SOLDIER_VEHICLE;
|
||||
pMercPath = pSoldier->pMercPath;
|
||||
/* after all, create an empty Vehicle list */
|
||||
pVehicleList = (VEHICLETYPE *) MemAlloc( sizeof( VEHICLETYPE ) );
|
||||
memset( pVehicleList, 0, sizeof( VEHICLETYPE ) );
|
||||
pVehicleList->fValid = 0;
|
||||
}
|
||||
else
|
||||
pMercPath = pVehicleList[ pSoldier->bVehicleID ].pMercPath;
|
||||
}
|
||||
else // a person
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user