Page 1 of 1

Fix for "avatar in container" issue?

Posted: Tue Nov 25, 2008 12:02 am
by Aerick
I've been thinking about adding a method to the Game_object class called "is_avatar" that returns true if the object is the avatar. Then add "obj->is_avatar()" to the first test in Container_game_object::add. Thoughts?

Also, how does one go about getting write access to the SVN? I've got some time over the next few weeks and would like to help with some of the outstanding issues in Exult.

Re: Fix for "avatar in container" issue?

Posted: Tue Nov 25, 2008 12:02 pm
by marzo
Submit them as patches to the patch tracker and we will commit the fixes.

Re: Fix for "avatar in container" issue?

Posted: Wed Nov 26, 2008 3:28 am
by Aerick
I've submitted a diff. Rather than add a new method, I simply check if the object is an NPC and if so check if the npc number is 0(avatar). If so, container.add returns false rather than continuing so you get a "won't fit" icon and everyone is happy. The diff also resolves the container volume limit when hackmover is enabled. My solution should be safe, it simply forces container.has_room() to return true if hackmover is enabled.

You might be a good man to ask about this one. So I found a bug where you can add items to locked chests if the chest is inside another container. A bit of sleuthing shows that the is_locked flag is never being set in Shape_info, so the checks aren't working when they try to block this. How/where/when is this flag supposed to be set?