From 7c784f8d3f358f8c7b35ecdbb6c7dc7da56aa523 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Mon, 18 Feb 2019 00:29:53 +1100 Subject: [PATCH] fix previous turf issue --- gamemodes/irresistible/cnr/features/gangs/turfs.pwn | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/features/gangs/turfs.pwn b/gamemodes/irresistible/cnr/features/gangs/turfs.pwn index 21d7eba..98e9f9e 100644 --- a/gamemodes/irresistible/cnr/features/gangs/turfs.pwn +++ b/gamemodes/irresistible/cnr/features/gangs/turfs.pwn @@ -321,8 +321,15 @@ hook OnServerGameDayEnd( ) } } + // get previous turf + new previous_turf = Iter_Prev( gangzoneturfs, g_gangHardpointTurf ); + + if ( previous_turf >= Iter_Last( gangzoneturfs ) ) { + previous_turf = INVALID_GANG_TURF; + } + // reset hardpoint - g_gangHardpointPreviousTurf = Iter_Prev( gangzoneturfs, g_gangHardpointTurf ); + g_gangHardpointPreviousTurf = previous_turf; g_gangHardpointTurf = INVALID_GANG_TURF; g_weekAveragePlayers = 0.0; g_weekSecondsElapsed = 0.0;