mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-19 02:38:32 +00:00
DIRECTOR: LINGO: Fix b_count for RECT and POINT
This commit is contained in:
parent
9a822aa057
commit
f673761135
@ -682,6 +682,8 @@ void LB::b_count(int nargs) {
|
||||
|
||||
switch (list.type) {
|
||||
case ARRAY:
|
||||
case RECT:
|
||||
case POINT:
|
||||
result.u.i = list.u.farr->arr.size();
|
||||
break;
|
||||
case PARRAY:
|
||||
|
@ -1596,7 +1596,8 @@ void LC::call(const Common::String &name, int nargs, bool allowRetVal) {
|
||||
// If the first argument is an ARRAY or PARRAY, it will use the builtin.
|
||||
// Otherwise, it will fall back to whatever handler is defined globally.
|
||||
Datum firstArg = g_lingo->peek(nargs - 1);
|
||||
if (firstArg.type == ARRAY || firstArg.type == PARRAY) {
|
||||
if (firstArg.type == ARRAY || firstArg.type == PARRAY ||
|
||||
firstArg.type == POINT || firstArg.type == RECT) {
|
||||
funcSym = g_lingo->_builtinListHandlers[name];
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,12 @@ scummvmAssertEqual(result, 3)
|
||||
set result = count([1: 2, 3: 4, 5: 6])
|
||||
scummvmAssertEqual(result, 3)
|
||||
|
||||
set result = count(rect(1, 2, 3, 4))
|
||||
scummvmAssertEqual(result, 4)
|
||||
|
||||
set result = count(point(1, 2))
|
||||
scummvmAssertEqual(result, 2)
|
||||
|
||||
set result = count("not an array")
|
||||
scummvmAssertEqual(result, "what is this")
|
||||
|
||||
@ -22,7 +28,7 @@ scummvmAssertEqual(result, "this is the worst")
|
||||
set result = add("even less of an array", 8)
|
||||
scummvmAssertEqual(result, "this is the worst")
|
||||
|
||||
set target = [1, 2, 3]
|
||||
set target = [1, 2, 3]
|
||||
add(target, 4)
|
||||
scummvmAssertEqual(count(target), 4)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user