[Scummvm-git-logs] scummvm master -> f6602245b90ac648d01824eb15d2a823f7c88666
rvanlaar
roland at rolandvanlaar.nl
Tue Aug 4 20:06:38 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
f6602245b9 DIRECTOR: LINGO: follow the itemDelimeter
Commit: f6602245b90ac648d01824eb15d2a823f7c88666
https://github.com/scummvm/scummvm/commit/f6602245b90ac648d01824eb15d2a823f7c88666
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2020-08-04T22:04:27+02:00
Commit Message:
DIRECTOR: LINGO: follow the itemDelimeter
`the number of items in _chunkExpression_` follows the itemDelimiter.
Changed paths:
engines/director/lingo/lingo-builtins.cpp
engines/director/lingo/tests/the.lingo
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 5ae1148e2d..f55f89c811 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -2369,7 +2369,7 @@ void LB::b_numberofitems(int nargs) {
int numberofitems = 1;
Common::String contents = d.asString();
for (uint32 i = 0; i < contents.size(); i++) {
- if (contents[i] == ',')
+ if (contents[i] == g_lingo->_itemDelimiter)
numberofitems++;
}
diff --git a/engines/director/lingo/tests/the.lingo b/engines/director/lingo/tests/the.lingo
index e38b228984..17c661843b 100644
--- a/engines/director/lingo/tests/the.lingo
+++ b/engines/director/lingo/tests/the.lingo
@@ -61,6 +61,8 @@ set the text of field 0 + 1 = "Hello"
set gMarkerName = the length of h + 2
+
+-- test the itemDelimiter
set save = the itemDelimiter
scummvmAssert(save=",")
set the itemDelimiter = ":"
@@ -70,3 +72,10 @@ scummvmAssert(the itemDelimiter=":")
set the itemDelimiter = ""
scummvmAssert(the itemDelimiter="")
set the itemDelimiter = save
+
+-- test number of items
+set chunkExpr to "one:two:three"
+scummvmAssertEqual(the number of items in chunkExpr, 1)
+set the itemDelimiter to ":"
+scummvmAssertEqual(the number of items in chunkExpr, 3)
+set the itemDelimiter to save
More information about the Scummvm-git-logs
mailing list