Don't write TurnTimeLeft deprecation warning if setter function was used
authorWuzzy <Wuzzy2@mail.ru>
Tue, 04 Sep 2018 22:59:08 +0200
changeset 13764 c46998ecd8fa
parent 13763 29abd3d5f9bb
child 13765 3d2a7c563d8e
Don't write TurnTimeLeft deprecation warning if setter function was used
hedgewars/uScript.pas
--- a/hedgewars/uScript.pas	Tue Sep 04 22:18:03 2018 +0200
+++ b/hedgewars/uScript.pas	Tue Sep 04 22:59:08 2018 +0200
@@ -3736,13 +3736,13 @@
 currentRTL:= ReadyTimeLeft;
 newTTL:= ScriptGetInteger('TurnTimeLeft');
 newRTL:= ScriptGetInteger('ReadyTimeLeft');
-if currentTTL <> newTTL then
+if (currentTTL <> newTTL) and (not isPendingTurnTimeLeft) then
     begin
     TurnTimeLeft:= newTTL;
     LuaWarning('Writing to TurnTimeLeft directly is deprecated! Use SetTurnTimeLeft instead!');
     end;
 
-if currentRTL <> newRTL then
+if (currentRTL <> newRTL) and (not isPendingReadyTimeLeft) then
     begin
     ReadyTimeLeft:= newRTL;
     LuaWarning('Writing to ReadyTimeLeft directly is deprecated! Use SetReadyTimeLeft instead!');