From aa3ea6705aa855823eab0b77a02d8c870c885a85 Mon Sep 17 00:00:00 2001 From: rtldg <55846624+rtldg@users.noreply.github.com> Date: Sun, 19 Sep 2021 13:56:06 +0000 Subject: [PATCH] make sure to clear zone edits and stuff so we don't duplicate zones --- addons/sourcemod/scripting/shavit-zones.sp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/addons/sourcemod/scripting/shavit-zones.sp b/addons/sourcemod/scripting/shavit-zones.sp index 05de32d6..89bfa295 100644 --- a/addons/sourcemod/scripting/shavit-zones.sp +++ b/addons/sourcemod/scripting/shavit-zones.sp @@ -2582,6 +2582,12 @@ public int CreateZoneConfirm_Handler(Menu menu, MenuAction action, int param1, i if(StrEqual(sInfo, "yes")) { + if (gI_ZoneID[param1] != -1) + { + // reenable so it can be wiped in the subsequent InsertZones->SQL_Callback->UnloadZones + gA_ZoneCache[gI_ZoneID[param1]].bZoneInitialized = true; + } + InsertZone(param1); gI_MapStep[param1] = 0; @@ -2590,6 +2596,11 @@ public int CreateZoneConfirm_Handler(Menu menu, MenuAction action, int param1, i else if(StrEqual(sInfo, "no")) { + if (gI_ZoneID[param1] != -1) + { + gA_ZoneCache[gI_ZoneID[param1]].bZoneInitialized = true; + } + Reset(param1); return 0; @@ -2843,7 +2854,16 @@ public int ZoneAdjuster_Handler(Menu menu, MenuAction action, int param1, int pa CreateAdjustMenu(param1, GetMenuSelectionPosition()); } } + else if (action == MenuAction_Cancel) + { + if (gI_ZoneID[param1] != -1) + { + // reenable original zone + gA_ZoneCache[gI_ZoneID[param1]].bZoneInitialized = true; + } + Reset(param1); + } else if(action == MenuAction_End) { delete menu;