dungeons-of-moria / umoria

Moria: a roguelike Dungeon Crawler game | Umoria Source Code
https://umoria.org
GNU General Public License v3.0
353 stars 76 forks source link

Bug with trap being picked up #22

Closed Alaharon123 closed 4 years ago

Alaharon123 commented 5 years ago

I apologize for not having full details and steps to reproduce and everything, but I am lasy. Hopefully someone else will give more details and this will serve as a starting point. I was playing Moria and I saw a trap and figured maybe it was a teleport trap and decided to walk into it (not the best strategy but don't judge me). I was scared it might be one of those traps that damages your equipment so I first took off all my equipment.

Anyway, I stepped on the trap and it was the one that summons a bunch of monsters. I put my equipment on one by one and then moved and the trap wasn't there any more. Whatever, I killed all the monsters and went on with my life. But then later I wanted to pray and I noticed that a was no longer my prayer book. I looked at my inventory and instead it was an item called "Error in objdes()". I went and dropped it and it showed up as a ^ and when looking at it it says "You see Error in objdes()"

I don't know if this is related to the bug or if something in the game actually does this, but my Charisma went down to 3 at some point as well. And not 3 with the regular number next to it and I need to drink a potion to get back my Charisma, but straight up 3.

I hope all this is enough information to find and fix the bug.

mrcook commented 5 years ago

Hi Alaharon123, many thanks for the detailed explanation. This will definitely help in narrowing down the bug.

If you're able could I ask you to get the version of Umoria you're playing? This is displayed on the splash screen when the game starts, or by typing ./umoria -v at the terminal.

Thanks, Michael

Alaharon123 commented 5 years ago

5.7.10

mrcook commented 4 years ago

I've only managed to spend a little time on this but so far I've not been able to replicate the issue. I have some time off work over the holiday period so I'll be able to dig a little deeper then.

mrcook commented 4 years ago

This evening I discovered two functions with the same inventoryDropItem name:

One is just a UI helper, but also inside the ui_inventory.cpp are two calls that very much look like they should be using the function in inventory.cpp.

I can't say at the moment if this would solve the bug you encountered Alaharon123, but this is certainly an error on my part!

I'll make the fix and try to push out a new version in the next days.

mrcook commented 4 years ago

I wasn't able to reproduce this bug - perhaps it's now fixed with the above - so I'm going to close this issue. If anyone should encounter it again, please do create a new issue.