deep-entertainment / issues

Issue tracker for deep Entertainment projects
1 stars 0 forks source link

[EGOVENTURE] Overridden cursors are not set when loading a game #32

Closed ThmsKnz closed 1 year ago

ThmsKnz commented 1 year ago

Describe the bug When loading a savegame that contains overridden cursors the cursors should be set automatically. This is also forseen in the coding, however the cursors are being reset before the overridden cursors are set and this clears the overriden_cursors Dictionary.

To Reproduce

  1. Set a breakpoint in function Egoventure._load() in line for cursor_type in state.overridden_cursors:
  2. Load a savegame that contains overridden cursors.
  3. In debugger you can see that variable p_state.overridden_cursors contains entries, but state.overridden_cursors is empty.

Reason The Cursors.reset() that is being called before handling the overridden cursors clears the overridden cursors in the state

Suggested fix In EgoVenture._load() function change:

    for cursor_type in state.overridden_cursors:
        var _cursor = state.overridden_cursors[cursor_type]
        Cursors.override(cursor_type, _cursor.texture, _cursor.hotspot)

into

    for cursor_type in p_state.overridden_cursors:
        var _cursor = p_state.overridden_cursors[cursor_type]
        Cursors.override(cursor_type, _cursor.texture, _cursor.hotspot)

In case you agree I'll submit a pull request with the change.

MikaelNyqvist commented 1 year ago

Suggested fix tested with successful result.

dploeger commented 1 year ago

Merged into Develop