diff options
author | Haru <haru@dotalux.com> | 2013-09-09 12:47:48 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2013-11-28 01:30:13 +0100 |
commit | ac6ae8c932efbca30ef1650fa5d7bd94ead336f5 (patch) | |
tree | b69f10556ad98f894c7c5346f57670debfd8961e /src/map/script.h | |
parent | 83d2d9343ab965c22816ac231973205ee67035e1 (diff) | |
download | hercules-ac6ae8c932efbca30ef1650fa5d7bd94ead336f5.tar.gz hercules-ac6ae8c932efbca30ef1650fa5d7bd94ead336f5.tar.bz2 hercules-ac6ae8c932efbca30ef1650fa5d7bd94ead336f5.tar.xz hercules-ac6ae8c932efbca30ef1650fa5d7bd94ead336f5.zip |
Added pre de/increment operators. Fixed post de/increment operators.
- [ This commit is part of a larger script engine related update ]
- Suffix ++ and -- operators now behave like in other languages
(updating the variable *after* its value is returned.)
- Prefix ++ and -- operators are added for parity with other
scripting/programming languages. They update the variable they're
applied to *before* returning its value.
- Please note that the implementation of the prefix form of those
operators (like it happens in most languages) is more efficient than
the suffix form. '++.@i' is (slightly) faster than '.@i++', or at
least not slower.
- Fixed some outdated script debug functions.
- Follow-up to c18f438.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/script.h')
-rw-r--r-- | src/map/script.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/map/script.h b/src/map/script.h index e0e5f9ea9..75a57d82b 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -196,8 +196,10 @@ typedef enum c_op { C_NOT, // ~ a C_R_SHIFT, // a >> b C_L_SHIFT, // a << b - C_ADD_PP, // ++a - C_SUB_PP, // --a + C_ADD_POST, // a++ + C_SUB_POST, // a-- + C_ADD_PRE, // ++a + C_SUB_PRE, // --a } c_op; enum hQueueOpt { |