diff options
Diffstat (limited to 'engines/director/lingo/lingo.cpp')
-rw-r--r-- | engines/director/lingo/lingo.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index 03533babe6..8935614242 100644 --- a/engines/director/lingo/lingo.cpp +++ b/engines/director/lingo/lingo.cpp @@ -301,9 +301,13 @@ int Datum::toInt() { switch (type) { case REFERENCE: toString(); + // fallthrough case STRING: u.i = atoi(u.s->c_str()); break; + case VOID: + u.i = 0; + break; case INT: // no-op break; @@ -323,9 +327,13 @@ double Datum::toFloat() { switch (type) { case REFERENCE: toString(); + // fallthrough case STRING: u.f = atof(u.s->c_str()); break; + case VOID: + u.f = 0.0; + break; case INT: u.f = (double)u.i; break; @@ -516,13 +524,13 @@ void Lingo::printAllVars() { for (SymbolHash::iterator i = _localvars->begin(); i != _localvars->end(); ++i) { debugN("%s, ", (*i)._key.c_str()); } - debug(""); + debugN("\n"); debugN(" Global vars: "); for (SymbolHash::iterator i = _globalvars.begin(); i != _globalvars.end(); ++i) { debugN("%s, ", (*i)._key.c_str()); } - debug(""); + debugN("\n"); } } // End of namespace Director |