Просмотр исходного кода

naming

change enum to OP_JMPIFNOTSTRING (same name as others doing similar for different types)
place case with other ifnot statements
marauder2k7 1 год назад
Родитель
Сommit
fed83cdb8f

+ 5 - 5
Engine/source/console/torquescript/compiledEval.cpp

@@ -1147,15 +1147,15 @@ Con::EvalResult CodeBlock::exec(U32 ip, const char* functionName, Namespace* thi
 
          ip = code[ip];
          break;
-      case OP_JMPIFF:
-         if (!stack[_STK--].getFloat())
+      case OP_JMPNOTSTRING:
+         if (stack[_STK--].getBool())
          {
             ip++;
             break;
          }
          ip = code[ip];
          break;
-      case OP_JMPIF:
+      case OP_JMPIFF:
          if (!stack[_STK--].getFloat())
          {
             ip++;
@@ -1163,8 +1163,8 @@ Con::EvalResult CodeBlock::exec(U32 ip, const char* functionName, Namespace* thi
          }
          ip = code[ip];
          break;
-      case OP_JMPSTRING:
-         if (stack[_STK--].getBool())
+      case OP_JMPIF:
+         if (!stack[_STK--].getFloat())
          {
             ip++;
             break;

+ 1 - 1
Engine/source/console/torquescript/compiler.h

@@ -62,9 +62,9 @@ namespace Compiler
 
       OP_JMPIFFNOT,
       OP_JMPIFNOT,
+      OP_JMPNOTSTRING,
       OP_JMPIFF,
       OP_JMPIF,
-      OP_JMPSTRING,
       OP_JMPIFNOT_NP,
       OP_JMPIF_NP,    // 10
       OP_JMP,