Fix for "avatar in container" issue?

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
Aerick
Posts: 22
Joined: Thu May 14, 2020 1:34 pm

Fix for "avatar in container" issue?

Post 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.
marzo
Site Admin
Posts: 1925
Joined: Thu May 14, 2020 1:34 pm

Re: Fix for "avatar in container" issue?

Post by marzo »

Submit them as patches to the patch tracker and we will commit the fixes.
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
Aerick
Posts: 22
Joined: Thu May 14, 2020 1:34 pm

Re: Fix for "avatar in container" issue?

Post 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?
Locked