diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/wage/entities.h | 2 | ||||
-rw-r--r-- | engines/wage/script.cpp | 15 |
2 files changed, 12 insertions, 5 deletions
diff --git a/engines/wage/entities.h b/engines/wage/entities.h index 0b5f96d37a..4f08cbb0c3 100644 --- a/engines/wage/entities.h +++ b/engines/wage/entities.h @@ -125,7 +125,7 @@ public: void setDesignBounds(Common::Rect *bounds); - Common::String toString() { return _name; } + Common::String toString() const { return _name; } }; class Chr : public Designed { diff --git a/engines/wage/script.cpp b/engines/wage/script.cpp index 9f8093c50c..de0b6bdb0e 100644 --- a/engines/wage/script.cpp +++ b/engines/wage/script.cpp @@ -56,6 +56,13 @@ namespace Wage { +static Common::String toString(const Designed *d) { + if (!d) + return "<NULL>"; + else + return d->toString(); +} + Common::String Script::Operand::toString() { switch(_type) { case NUMBER: @@ -64,13 +71,13 @@ Common::String Script::Operand::toString() { case TEXT_INPUT: return *_value.string; case OBJ: - return _value.obj->toString(); + return Wage::toString(_value.obj); case CHR: - return _value.chr->toString(); + return Wage::toString(_value.chr); case SCENE: - return _value.scene->toString(); + return Wage::toString(_value.scene); case CLICK_INPUT: - return _value.inputClick->toString(); + return Wage::toString(_value.inputClick); default: error("Unhandled operand type: _type"); } |