From c684db2c20fe5c67c2eca82e5d7f176233075dd8 Mon Sep 17 00:00:00 2001 From: Bukz Date: Tue, 19 Feb 2013 04:08:43 +0000 Subject: [PATCH] some boolean functions simplified git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7230 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- config/autosave.cfg | 2 +- config/scripts.cfg | 6 +++--- config/survival.cfg | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/autosave.cfg b/config/autosave.cfg index 1afe0592..30d6490d 100644 --- a/config/autosave.cfg +++ b/config/autosave.cfg @@ -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 diff --git a/config/scripts.cfg b/config/scripts.cfg index 0efad7e2..ae5ecf37 100644 --- a/config/scripts.cfg +++ b/config/scripts.cfg @@ -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) [ diff --git a/config/survival.cfg b/config/survival.cfg index 710c10bd..c80efa07 100644 --- a/config/survival.cfg +++ b/config/survival.cfg @@ -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