Ennowulff / axage

ABAP teXt Adventure Game Engine
Apache License 2.0
19 stars 9 forks source link

invalid move is not caught and leads to a dump #11

Closed AndreaBorgia-Abo closed 1 year ago

AndreaBorgia-Abo commented 1 year ago

Testing @jung-thomas axage_example on HANA1909 ( shhh, don't tell SAP ;) ) axage and abap2ui5 are up to date.

Sequence: N, execute E, execute

dump in ZCL_AXAGE_ENGINE, method CMD_LOOK player->location is initial and this fails: IF player->location->things

This may or may not have something to do with the fact that N was not an allowable exit in the first move ;) image

At the first step, in method INTERPRETE, this comparison fails: IF player->location->north = zcl_axage_room=>no_exit. During initialization of "entrance", N is correctly marked "no exit" but the objects are different: image

jung-thomas commented 1 year ago

Fixed via PR #12

The serialization of the classes in the stateless version means that object instance ids no longer match exactly. Therefore, the check to no_exit instance of room will always fail. Changed to checking against the room name instead.

Ennowulff commented 1 year ago

thanks

AndreaBorgia-Abo commented 1 year ago

The serialization of the classes in the stateless version means that object instance ids no longer match exactly.

Suspected as much, thanks for the confirmation and for the fix as well :)