diff options
author | Scott Percival | 2019-12-22 15:51:28 +0800 |
---|---|---|
committer | Scott Percival | 2019-12-23 08:58:14 +0800 |
commit | afea3787149f805be9925e5843405ceb0c2955a3 (patch) | |
tree | d0e9a12cfd8884a7be46e6a1cff08ab326ada3bd /engines | |
parent | 1c13d5d6051e606ccabe733ba645e31c85533688 (diff) | |
download | scummvm-rg350-afea3787149f805be9925e5843405ceb0c2955a3.tar.gz scummvm-rg350-afea3787149f805be9925e5843405ceb0c2955a3.tar.bz2 scummvm-rg350-afea3787149f805be9925e5843405ceb0c2955a3.zip |
DIRECTOR: LINGO: Add string support to c_eq and c_neq
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/lingo/lingo-code.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp index 6d50a59c23..458d11a888 100644 --- a/engines/director/lingo/lingo-code.cpp +++ b/engines/director/lingo/lingo-code.cpp @@ -817,7 +817,10 @@ void Lingo::c_eq() { Datum d2 = g_lingo->pop(); Datum d1 = g_lingo->pop(); - if (g_lingo->alignTypes(d1, d2) == FLOAT) { + if (d1.type == STRING && d2.type == STRING) { + d1.u.i = (*d1.u.s == *d2.u.s) ? 1 : 0; + d1.type = INT; + } else if (g_lingo->alignTypes(d1, d2) == FLOAT) { d1.u.i = (d1.u.f == d2.u.f) ? 1 : 0; d1.type = INT; } else { @@ -830,7 +833,10 @@ void Lingo::c_neq() { Datum d2 = g_lingo->pop(); Datum d1 = g_lingo->pop(); - if (g_lingo->alignTypes(d1, d2) == FLOAT) { + if (d1.type == STRING && d2.type == STRING) { + d1.u.i = (*d1.u.s != *d2.u.s) ? 1 : 0; + d1.type = INT; + } else if (g_lingo->alignTypes(d1, d2) == FLOAT) { d1.u.i = (d1.u.f != d2.u.f) ? 1 : 0; d1.type = INT; } else { |