Bed bugs and other usecode stuff
Posted: Sat Dec 06, 2008 8:17 am
First off, I'm not making a bug report in the tracker cuz I'm trying to resolve the issue myself. Here's the scenario:
Double-clicking on Spark's dad's bed(the upstairs one) causes the avatar to use Spark's bed, which is one story directly below it. A bit of debugging shows that the correct bed is being located inside the Game_window::double_clicked() method and obj->activate() is performed on the right object. activate calls the correct usecode function for shape 0x02B8 which simply checks if the event which called it was a double-click and if so, it calls function 0x0800. 0x0800 seems to be a bed-related function which checks the combat status and has one of the party members bitch at you if you try to sleep while in combat, otherwise it "does stuff". My problem is, I don't know enough about usecode to decipher exactly what's going on here. I could really use some help by answering a few questions I have...
1. What's the best tool(s) to use to disassemble usecode? I've used "wud" so far. Is there an existing way to use labels to help name known functions with wud or other tools?
2. Are there any docs that describe usecode in the form output by said tool(s)?
A few observations I've made about this bug:
If I remove the bedding from the bed downstairs:
1. Double-clicking on the upstairs bed works fine then.
2. Double-clicking on the downstairs bed causes the Avatar to use the upstairs bed.
Removing the bedding from both beds makes both beds work as they should..
Double-clicking on Spark's dad's bed(the upstairs one) causes the avatar to use Spark's bed, which is one story directly below it. A bit of debugging shows that the correct bed is being located inside the Game_window::double_clicked() method and obj->activate() is performed on the right object. activate calls the correct usecode function for shape 0x02B8 which simply checks if the event which called it was a double-click and if so, it calls function 0x0800. 0x0800 seems to be a bed-related function which checks the combat status and has one of the party members bitch at you if you try to sleep while in combat, otherwise it "does stuff". My problem is, I don't know enough about usecode to decipher exactly what's going on here. I could really use some help by answering a few questions I have...
1. What's the best tool(s) to use to disassemble usecode? I've used "wud" so far. Is there an existing way to use labels to help name known functions with wud or other tools?
2. Are there any docs that describe usecode in the form output by said tool(s)?
A few observations I've made about this bug:
If I remove the bedding from the bed downstairs:
1. Double-clicking on the upstairs bed works fine then.
2. Double-clicking on the downstairs bed causes the Avatar to use the upstairs bed.
Removing the bedding from both beds makes both beds work as they should..