hedgewars/uScript.pas
changeset 11179 98d14636c371
parent 11173 fe2f269dc80f
child 11196 f4cf2cdea8e5
equal deleted inserted replaced
11178:7b2b181f84f8 11179:98d14636c371
  2886     ScriptSetNil('CurrentHedgehog');
  2886     ScriptSetNil('CurrentHedgehog');
  2887 end;
  2887 end;
  2888 
  2888 
  2889 procedure GetGlobals;
  2889 procedure GetGlobals;
  2890 begin
  2890 begin
       
  2891 // TODO
       
  2892 // Use setters instead, because globals should be read-only!
       
  2893 // Otherwise globals might be changed by Lua, but then unexpectatly overwritten by engine when a ScriptCall is triggered by whatever Lua is doing!
       
  2894 // 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.
       
  2895 // It is inconsistent anyway to have some globals be read-only and others not with no indication whatsoever.
       
  2896 // -- sheepluva
  2891 TurnTimeLeft:= ScriptGetInteger('TurnTimeLeft');
  2897 TurnTimeLeft:= ScriptGetInteger('TurnTimeLeft');
  2892 end;
  2898 end;
  2893 
  2899 
  2894 procedure ScriptCall(fname : shortstring);
  2900 procedure ScriptCall(fname : shortstring);
  2895 begin
  2901 begin