]> git.localhorst.tv Git - l2e.git/commitdiff
implemented modulo operation for scripts
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 14 Oct 2012 11:56:25 +0000 (13:56 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 14 Oct 2012 11:56:25 +0000 (13:56 +0200)
src/common/Script.h
src/common/ScriptRunner.cpp

index 93bc53105dd3a4de050e802f66d23a6bb8a4971c..0dbaf4d3b7bad72866af810a2a13862102206a85 100644 (file)
@@ -29,6 +29,9 @@ public:
                CODE_ADD_V0,
                CODE_ADD_V1,
 
+               CODE_MOD_I0,
+               CODE_MOD_I1,
+
                CODE_RAND_I0,
                CODE_RAND_I1,
 
index 110b702b88a86aad29297759e5b666940d203da5..c1022c4c1ed98c62047096ddc1c252ea273e9546 100644 (file)
@@ -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;