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;