some boolean functions simplified

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7230 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Bukz
2013-02-19 04:08:43 +00:00
parent cdf8a67f87
commit c684db2c20
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ check2init autosavemap 0 // Autosavemap system disabled by default
check2init timeBetAutoSaves 300000 // Once every 5 minutes.
check2init numAutoSaveBackups 3 // Make a map .bak every 3 autosaves (15 minutes) by default
const autoSaveCheck [ sleep $timeBetAutoSaves [ doAutoSave ] 1 ]
const autoSaveCheck [ sleep $timeBetAutoSaves doAutoSave 1 ]
const execAutoSave [
++ numAutoSaves
+3 -3
View File
@@ -155,7 +155,7 @@ const add2list [ if (strcmp [] (getalias $arg1)) [ $arg1 = $arg2 ] [ $arg
const add2bind [ if (! (strstr (keybind $arg1) $arg2)) [ bind $arg1 (format [%1; %2] (keybind $arg1) $arg2) ] ] // works exactly like add2alias except for used with keybinds
// Weapon switching/action utilities.
const hasprimary [ if (= (curweapon) (currentprimary)) [ result 1 ] [ result 0 ] ]
const hasprimary [ result (= (curweapon) (currentprimary)) ]
const primary [ weapon (currentprimary) ]
const ptoggle [ if (hasprimary) $arg1 primary ] // Toggle between primary/specified weapon
const secondary [ weapon $PISTOL ]
@@ -167,8 +167,8 @@ const gndtoggle [ ptoggle grenades ]
const altaction [ (concatword altaction_ (curweapon)) ]
const checkmag [ if (|| (magcontent $arg1) (magreserve $arg1)) [ result 1 ] [ result 0 ] ]
const checkrange [ if (&& (>=f $arg1 $arg2) (<=f $arg1 $arg3)) [ result 1 ] [ result 0 ] ]
const checkmag [ result (|| (magcontent $arg1) (magreserve $arg1)) ]
const checkrange [ result (&& (>=f $arg1 $arg2) (<=f $arg1 $arg3)) ]
const quicknadethrow_old [
if (> (magcontent $GRENADES) 0) [
+1 -1
View File
@@ -113,7 +113,7 @@ const findCenter [
const teleportPlayer [ if (! (alive)) attack; if (!= $gamespeed 100) [ gamespeed 100 ]; survTeleported = 1; findCenter; if (! $editing) edittoggle; go_to $midZoneX $midZoneY; sleep 25 edittoggle ]
const isInZone [ if (&& (checkrange (player1 x) (at $zone 0) (at $zone 1)) (checkrange (player1 y) (at $zone 2) (at $zone 3))) [ result 1 ] [ result 0 ] ]
const isInZone [ result (&& (checkrange (player1 x) (at $zone 0) (at $zone 1)) (checkrange (player1 y) (at $zone 2) (at $zone 3))) ]
changingspeed = 0; changinggamma = 0