aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/kyra/script.cpp40
-rw-r--r--engines/kyra/script.h2
2 files changed, 9 insertions, 33 deletions
diff --git a/engines/kyra/script.cpp b/engines/kyra/script.cpp
index b10a4b32bf..df933c3ed8 100644
--- a/engines/kyra/script.cpp
+++ b/engines/kyra/script.cpp
@@ -435,59 +435,35 @@ void EMCInterpreter::cmd_eval(EMCState* script) {
switch (_parameter) {
case 0:
- if (!val2 || !val1)
- ret = 0;
- else
- ret = 1;
+ ret = (val2 && val1) ? 1 : 0;
break;
case 1:
- if (val2 || val1)
- ret = 1;
- else
- ret = 0;
+ ret = (val2 || val1) ? 1 : 0;
break;
case 2:
- if (val1 == val2)
- ret = 1;
- else
- ret = 0;
+ ret = (val1 == val2) ? 1 : 0;
break;
case 3:
- if (val1 != val2)
- ret = 1;
- else
- ret = 0;
+ ret = (val1 != val2) ? 1 : 0;
break;
case 4:
- if (val1 > val2)
- ret = 1;
- else
- ret = 0;
+ ret = (val1 > val2) ? 1 : 0;
break;
case 5:
- if (val1 >= val2)
- ret = 1;
- else
- ret = 0;
+ ret = (val1 >= val2) ? 1 : 0;
break;
case 6:
- if (val1 < val2)
- ret = 1;
- else
- ret = 0;
+ ret = (val1 < val2) ? 1 : 0;
break;
case 7:
- if (val1 <= val2)
- ret = 1;
- else
- ret = 0;
+ ret = (val1 <= val2) ? 1 : 0;
break;
case 8:
diff --git a/engines/kyra/script.h b/engines/kyra/script.h
index 2b97a83289..6e08017974 100644
--- a/engines/kyra/script.h
+++ b/engines/kyra/script.h
@@ -47,7 +47,7 @@ struct EMCData {
};
struct EMCState {
- uint16 *ip;
+ const uint16 *ip;
const EMCData *dataPtr;
int16 retValue;
uint16 bp;