From: Daniel Karbach Date: Sun, 14 Oct 2012 11:56:25 +0000 (+0200) Subject: implemented modulo operation for scripts X-Git-Url: http://git.localhorst.tv/?a=commitdiff_plain;ds=inline;h=238da3a706448d4c592460684e2a5a2c0eb81a04;p=l2e.git implemented modulo operation for scripts --- diff --git a/src/common/Script.h b/src/common/Script.h index 93bc531..0dbaf4d 100644 --- a/src/common/Script.h +++ b/src/common/Script.h @@ -29,6 +29,9 @@ public: CODE_ADD_V0, CODE_ADD_V1, + CODE_MOD_I0, + CODE_MOD_I1, + CODE_RAND_I0, CODE_RAND_I1, diff --git a/src/common/ScriptRunner.cpp b/src/common/ScriptRunner.cpp index 110b702..c1022c4 100644 --- a/src/common/ScriptRunner.cpp +++ b/src/common/ScriptRunner.cpp @@ -93,6 +93,12 @@ void ScriptRunner::Exec(unsigned char code) { case Script::CODE_ADD_V1: vector1 += PopVector(); break; + case Script::CODE_MOD_I0: + integer0 %= PopInt(); + break; + case Script::CODE_MOD_I1: + integer1 %= PopInt(); + break; case Script::CODE_RAND_I0: integer0 = std::rand(); break;