From c42d68ff0fa8987b167f52fc12b3c4ac74e8b404 Mon Sep 17 00:00:00 2001 From: Wanne Date: Mon, 9 Jan 2012 11:13:25 +0000 Subject: [PATCH] - Fixed possible assertion in Scheduling.cpp git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4881 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Scheduling.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Strategic/Scheduling.cpp b/Strategic/Scheduling.cpp index 2f903b44b..5edeb108b 100644 --- a/Strategic/Scheduling.cpp +++ b/Strategic/Scheduling.cpp @@ -1167,10 +1167,15 @@ void PostNextSchedule( SOLDIERTYPE *pSoldier ) usBestTime = NUM_MIN_IN_DAY - (usTime - pSchedule->usTime[ i ]); iBestIndex = i; } - } - Assert( iBestIndex >= 0 ); + } - AddStrategicEvent( EVENT_PROCESS_TACTICAL_SCHEDULE, GetWorldDayInMinutes() + pSchedule->usTime[iBestIndex], pSchedule->ubScheduleID ); + // WANNE: Removed the assertion and added the check instead + //Assert( iBestIndex >= 0 ); + + if (iBestIndex >= 0) + { + AddStrategicEvent( EVENT_PROCESS_TACTICAL_SCHEDULE, GetWorldDayInMinutes() + pSchedule->usTime[iBestIndex], pSchedule->ubScheduleID ); + } }