Pyrdacor/Ambermoon

Crash or graphic mess up when leaving a conversation without taking the items

Pyrdacor opened this issue · 4 comments

For example give the 4 golden horseshoes to Tolimar and leave without the reward items. Confirm the question with Yes. Then talk to him again.

I could fix it in Ambermoon Advanced but it is a bit complex. Basically each window has an update function which is called each few ticks until the window is closed.

In conversations this update function checks if there are any items in the item grid (reward items etc). If so it will show the item grid, otherwise it will hide the item grid. This is done by opening another "window" and closing it when hiding. In Jurie's window system, every state is basically a window or screen.

This new "window" which shows the item grid, uses the same update function and event handlers, so it behaves exactly as the window without the item grid. Of course the item grid provides a few more to drag and drop items etc.

The problem now is that if you close the conversation and there are remaining items, the update function will recreate the item grid by opening it. This seems to happen after the real window is closed. When you open a new conversation window, it accesses the same item grid window data structure. Therefore you see parts of it drawn over the new conversation window and all kind of crazy stuff happens.

Normally this doesn't happen. Either you take all items (the the item grid is removed and not re-created) or abort and stay in the window.

There are two approaches I can think of without touching the whole window event stuff:

  • Add a bool to avoid updating the item grid when the window is about to close (that's what I did)
  • Clear all items from the item grid, so that it is not recreated (needs a new bigger function)
a1exh commented

FYI this is tracked on my spreadsheet as unfixed error 12 (Meynaf 06/04/2009)

Here is a link back to the Bug report

http://eab.abime.net/showpost.php?p=533428&postcount=175

Ah thanks. It's been a while since I had a look at the spreadsheet. Currently I only find bugs while testing stuff for the extension. I found this particular bug when I was testing a new event. I had to program quite a lot m68k asm and thought that I messed up when I saw those fancy graphic issues and the crash. But luckily it wasn't my fault. :D

Fixing those bugs is relatively easy nowadays since I have the full ASM. So in theory I can also add code in-between etc. The only caveat is, that I commented much code in Ghidra and Ghidra can display stuff in a much nicer way. For example structures etc.

So when I adjust the exported ASM and would re-import it to Ghidra, all the comments and labels would be gone.

In the near future I would like to build a Ghidra plugin to re-import the ASM but I have no experience with that yet. This way we could freely change the ASM and still update it in Ghidra.

This would make code fixing and even adding new features very easy.