add TODO
authorsheepluva
Thu, 17 Sep 2015 07:41:40 +0200
changeset 11183 98d14636c371
parent 11182 7b2b181f84f8
child 11184 1750a1ce7131
add TODO
hedgewars/uScript.pas
--- a/hedgewars/uScript.pas	Wed Sep 16 08:58:51 2015 -0400
+++ b/hedgewars/uScript.pas	Thu Sep 17 07:41:40 2015 +0200
@@ -2888,6 +2888,12 @@
 
 procedure GetGlobals;
 begin
+// TODO
+// Use setters instead, because globals should be read-only!
+// Otherwise globals might be changed by Lua, but then unexpectatly overwritten by engine when a ScriptCall is triggered by whatever Lua is doing!
+// Sure, one could work around that in engine (e.g. by setting writable globals in SetGlobals only when their engine-side value has actually changed since SetGlobals was called the last time...), but things just get messier and messier then.
+// It is inconsistent anyway to have some globals be read-only and others not with no indication whatsoever.
+// -- sheepluva
 TurnTimeLeft:= ScriptGetInteger('TurnTimeLeft');
 end;