Every map should have an option to use this, to prevent laming.
Thank you!
Edit: Wait... why are you setting a global variable to GetLocalPlayer()? I'm pretty sure that desyncs.
Jass:
library PreventSave initializer onInit
globals
boolean GameAllowSave = false
endglobals
//====================================
// Do not edit below this line
//====================================
globals
private dialog D = DialogCreate()
private timer T = CreateTimer()
endglobals
private function Exit takes nothing returns nothing
call DialogDisplay(GetLocalPlayer(), D, false)
endfunction
private function StopSave takes nothing returns nothing
if not GameAllowSave then
call DialogDisplay(GetLocalPlayer(), D, true)
call TimerStart(T, 0.00, false, function Exit)
endif
endfunction
private function onInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterGameEvent(t, EVENT_GAME_SAVE)
call TriggerAddAction(t, function StopSave)
endfunction
endlibrary
Shouldnt it be like that?