From 67e049161f4be78675db1efa359d84ca12a5f06d Mon Sep 17 00:00:00 2001 From: twanvl Date: Thu, 10 May 2007 16:26:21 +0000 Subject: [PATCH] == and != default to strings instead of ints git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@331 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/script/context.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/script/context.cpp b/src/script/context.cpp index 9abd29b7..10e94112 100644 --- a/src/script/context.cpp +++ b/src/script/context.cpp @@ -238,12 +238,14 @@ void instrUnary (UnaryInstructionType i, ScriptValueP& a) { // operator on strings or doubles or ints #define OPERATOR_SDI(OP) \ - if (at == SCRIPT_STRING || bt == SCRIPT_STRING) { \ + if (at == SCRIPT_STRING || bt == SCRIPT_STRING) { \ a = to_script(a->toString() OP b->toString()); \ } else if (at == SCRIPT_DOUBLE || bt == SCRIPT_DOUBLE) { \ a = to_script((double)*a OP (double)*b); \ - } else { \ + } else if (at == SCRIPT_INT || bt == SCRIPT_INT ) { \ a = to_script((int)*a OP (int)*b); \ + } else { \ + a = to_script(a->toString() OP b->toString()); \ } \ break