diff options
Diffstat (limited to 'engines/wage')
-rw-r--r-- | engines/wage/script.cpp | 17 | ||||
-rw-r--r-- | engines/wage/script.h | 2 |
2 files changed, 15 insertions, 4 deletions
diff --git a/engines/wage/script.cpp b/engines/wage/script.cpp index de0b6bdb0e..7a8ba14ad4 100644 --- a/engines/wage/script.cpp +++ b/engines/wage/script.cpp @@ -63,13 +63,24 @@ static Common::String toString(const Designed *d) { return d->toString(); } -Common::String Script::Operand::toString() { +static Common::String toString(const Common::String *d) { + if (!d) + return "<NULL>"; + else + return *d; +} + +static Common::String toString(int16 val) { + return Common::String::format("%d", val); +} + +Common::String Script::Operand::toString() const { switch(_type) { case NUMBER: - return Common::String::format("%d", _value.number); + return Wage::toString(_value.number); case STRING: case TEXT_INPUT: - return *_value.string; + return Wage::toString(_value.string); case OBJ: return Wage::toString(_value.obj); case CHR: diff --git a/engines/wage/script.h b/engines/wage/script.h index df7ec7e4d6..279e4cfae8 100644 --- a/engines/wage/script.h +++ b/engines/wage/script.h @@ -119,7 +119,7 @@ private: delete _value.string; } - Common::String toString(); + Common::String toString() const; }; struct ScriptText { |