hedgewars/uScript.pas
changeset 9245 1dfdf35dd35d
parent 9208 acb2492288e5
child 9283 76e68c136a11
--- a/hedgewars/uScript.pas	Thu Jun 20 11:15:50 2013 +0400
+++ b/hedgewars/uScript.pas	Fri Jun 21 12:26:55 2013 -0400
@@ -231,8 +231,7 @@
 var i : integer;
 begin
     for i:= 1 to lua_gettop(L) do
-        if (GameFlags and lua_tointeger(L, i)) = 0 then
-            GameFlags := GameFlags + LongWord(lua_tointeger(L, i));
+        GameFlags := GameFlags or LongWord(lua_tointeger(L, i));
     ScriptSetInteger('GameFlags', GameFlags);
     lc_enablegameflags:= 0;
 end;
@@ -241,8 +240,7 @@
 var i : integer;
 begin
     for i:= 1 to lua_gettop(L) do
-        if (GameFlags and lua_tointeger(L, i)) <> 0 then
-            GameFlags := GameFlags - LongWord(lua_tointeger(L, i));
+        GameFlags := GameFlags and not(LongWord(lua_tointeger(L, i)));
     ScriptSetInteger('GameFlags', GameFlags);
     lc_disablegameflags:= 0;
 end;