From dcb53393c12be6e1f8cd9ae91d01ccd0c115817a Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Thu, 11 Aug 2022 13:34:37 +0300 Subject: [PATCH] FIx opFloatMessage string arg handling Closes #129 --- src/interpreter_extra.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/interpreter_extra.cc b/src/interpreter_extra.cc index d8997b9..f86624b 100644 --- a/src/interpreter_extra.cc +++ b/src/interpreter_extra.cc @@ -3103,7 +3103,11 @@ static void _op_inven_cmds(Program* program) static void opFloatMessage(Program* program) { int floatingMessageType = programStackPopInteger(program); - char* string = programStackPopString(program); + ProgramValue stringValue = programStackPopValue(program); + char* string = NULL; + if ((stringValue.opcode & VALUE_TYPE_MASK) == VALUE_TYPE_STRING) { + string = programGetString(program, stringValue.opcode, stringValue.integerValue); + } Object* obj = static_cast(programStackPopPointer(program)); int color = _colorTable[32747];