Skip to content

Commit

Permalink
Fix color setters
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbatalov committed Oct 28, 2022
1 parent 1bbd586 commit 01f264e
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/interpreter_lib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1465,8 +1465,9 @@ static void opSetTextColor(Program* program)
}

for (int arg = 0; arg < 3; arg++) {
if (((value[arg].opcode & VALUE_TYPE_MASK) != VALUE_TYPE_FLOAT && (value[arg].opcode & VALUE_TYPE_MASK) != VALUE_TYPE_INT)
|| value[arg].floatValue == 0.0) {
if ((value[arg].opcode & VALUE_TYPE_MASK) != VALUE_TYPE_FLOAT
&& (value[arg].opcode & VALUE_TYPE_MASK) == VALUE_TYPE_INT
&& value[arg].integerValue != 0) {
programFatalError("Invalid type given to settextcolor");
}
}
Expand All @@ -1492,8 +1493,9 @@ static void opSayOptionColor(Program* program)
}

for (int arg = 0; arg < 3; arg++) {
if (((value[arg].opcode & VALUE_TYPE_MASK) != VALUE_TYPE_FLOAT && (value[arg].opcode & VALUE_TYPE_MASK) != VALUE_TYPE_INT)
|| value[arg].floatValue == 0.0) {
if ((value[arg].opcode & VALUE_TYPE_MASK) != VALUE_TYPE_FLOAT
&& (value[arg].opcode & VALUE_TYPE_MASK) == VALUE_TYPE_INT
&& value[arg].integerValue != 0) {
programFatalError("Invalid type given to sayoptioncolor");
}
}
Expand All @@ -1519,8 +1521,9 @@ static void opSayReplyColor(Program* program)
}

for (int arg = 0; arg < 3; arg++) {
if (((value[arg].opcode & VALUE_TYPE_MASK) != VALUE_TYPE_FLOAT && (value[arg].opcode & VALUE_TYPE_MASK) != VALUE_TYPE_INT)
|| value[arg].floatValue == 0.0) {
if ((value[arg].opcode & VALUE_TYPE_MASK) != VALUE_TYPE_FLOAT
&& (value[arg].opcode & VALUE_TYPE_MASK) == VALUE_TYPE_INT
&& value[arg].integerValue != 0) {
programFatalError("Invalid type given to sayreplycolor");
}
}
Expand All @@ -1546,8 +1549,9 @@ static void opSetHighlightColor(Program* program)
}

for (int arg = 0; arg < 3; arg++) {
if (((value[arg].opcode & VALUE_TYPE_MASK) != VALUE_TYPE_FLOAT && (value[arg].opcode & VALUE_TYPE_MASK) != VALUE_TYPE_INT)
|| value[arg].floatValue == 0.0) {
if ((value[arg].opcode & VALUE_TYPE_MASK) != VALUE_TYPE_FLOAT
&& (value[arg].opcode & VALUE_TYPE_MASK) == VALUE_TYPE_INT
&& value[arg].integerValue != 0) {
programFatalError("Invalid type given to sayreplycolor");
}
}
Expand Down

0 comments on commit 01f264e

Please sign in to comment.