From 49c33bfdfb4339853b7f059c6345b128b2f076eb Mon Sep 17 00:00:00 2001 From: Lesh Date: Sun, 19 Nov 2006 14:04:11 +0000 Subject: [PATCH] - bug fix: reinforcements git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@636 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Soldier Init List.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Tactical/Soldier Init List.cpp b/Tactical/Soldier Init List.cpp index 97244989..b5e4eb69 100644 --- a/Tactical/Soldier Init List.cpp +++ b/Tactical/Soldier Init List.cpp @@ -2372,6 +2372,11 @@ void AddSoldierInitListMilitiaOnEdge( UINT8 ubStrategicInsertionCode, UINT8 ubNu ubTotalSoldiers--; pSoldier = TacticalCreateMilitia(SOLDIER_CLASS_ELITE_MILITIA); + // Lesh: if pSoldier is NULL then no slot for a new men or other problems + // it better to leave this function is such case + if ( !pSoldier ) + return; + pSoldier->bOrders = ONGUARD; pSoldier->ubInsertionDirection = bDesiredDirection; @@ -2397,6 +2402,11 @@ void AddSoldierInitListMilitiaOnEdge( UINT8 ubStrategicInsertionCode, UINT8 ubNu ubTotalSoldiers--; pSoldier = TacticalCreateMilitia(SOLDIER_CLASS_REG_MILITIA); + // Lesh: if pSoldier is NULL then no slot for a new men or other problems + // it better to leave this function is such case + if ( !pSoldier ) + return; + pSoldier->bOrders = ONGUARD; pSoldier->ubInsertionDirection = bDesiredDirection; @@ -2422,6 +2432,11 @@ void AddSoldierInitListMilitiaOnEdge( UINT8 ubStrategicInsertionCode, UINT8 ubNu ubTotalSoldiers--; pSoldier = TacticalCreateMilitia(SOLDIER_CLASS_GREEN_MILITIA); + // Lesh: if pSoldier is NULL then no slot for a new men or other problems + // it better to leave this function is such case + if ( !pSoldier ) + return; + pSoldier->bOrders = ONGUARD; pSoldier->ubInsertionDirection = bDesiredDirection;