mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Script errors now have information on where the error occureed (what value);
Script operator "int + object" now uses string concatenation instead of converting the object to integer; Html export window uses a dummy set for editing options, so we don't pollute the set's undo stack; Choice rendererer in nativelook 'both' style always leaves room for the icon; Version bump git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@438 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+9
-11
@@ -240,14 +240,13 @@ void instrUnary (UnaryInstructionType i, ScriptValueP& a) {
|
||||
} \
|
||||
break
|
||||
|
||||
// operator on strings or doubles or ints
|
||||
// operator on strings or doubles or ints, when in doubt, uses strings
|
||||
#define OPERATOR_SDI(OP) \
|
||||
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 if (at == SCRIPT_INT || bt == SCRIPT_INT ) { \
|
||||
if (at == SCRIPT_INT && bt == SCRIPT_INT) { \
|
||||
a = to_script((int)*a OP (int)*b); \
|
||||
} else if ((at == SCRIPT_INT || at == SCRIPT_DOUBLE) && \
|
||||
(bt == SCRIPT_INT || bt == SCRIPT_DOUBLE)) { \
|
||||
a = to_script((double)*a OP (double)*b); \
|
||||
} else { \
|
||||
a = to_script(a->toString() OP b->toString()); \
|
||||
} \
|
||||
@@ -288,12 +287,11 @@ void instrBinary (BinaryInstructionType i, ScriptValueP& a, const ScriptValueP&
|
||||
// a = a;
|
||||
} else if (at == SCRIPT_FUNCTION && bt == SCRIPT_FUNCTION) {
|
||||
a = new_intrusive2<ScriptCompose>(a, b);
|
||||
} else if (at == SCRIPT_STRING || bt == SCRIPT_STRING) {
|
||||
a = to_script(a->toString() + b->toString());
|
||||
} else if (at == SCRIPT_DOUBLE || bt == SCRIPT_DOUBLE) {
|
||||
a = to_script((double)*a + (double)*b);
|
||||
} else if (at == SCRIPT_INT || bt == SCRIPT_INT) {
|
||||
} else if (at == SCRIPT_INT && bt == SCRIPT_INT) {
|
||||
a = to_script((int)*a + (int)*b);
|
||||
} else if ((at == SCRIPT_INT || at == SCRIPT_DOUBLE) &&
|
||||
(bt == SCRIPT_INT || bt == SCRIPT_DOUBLE)) {
|
||||
a = to_script((double)*a + (double)*b);
|
||||
} else {
|
||||
a = to_script(a->toString() + b->toString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user