[CF-Devel] Flying monster stealing patch
crossfire-devel at archives.real-time.com
crossfire-devel at archives.real-time.com
Tue Nov 18 01:40:39 CST 2003
H. S. Teoh wrote:
>
Hi all,
>
>
After testing my new flying monster, Katia & I found out that it cannot
>
steal because it's flying (pick_up() fails). In the process, we uncovered
>
a bug in the stealing code, that tells the player something was stolen
>
even if pick_up() subsequently fails. I tried to move the call to
>
esrv_del_item to inside the if-statement that checks if the item was
>
picked up, but it didn't work (apparently it's not as simple as I thought;
>
if the thief wasn't a player, the if-statement fails). Perhaps Mark or
>
somebody can figure out the correct fix for this bug.
Well, ideally, pick_up() returns status on if it works or not.
Saving that, the following would need to be done:
The tag of the object stored away (because pick_up could merge it with another).
Check to see if tmp->env changes - if so, the object was stolen. This means
storing the old ->env field away. If that succeeds, then send the esrv_del_item
with the tag that was stored away.
>
>
But anyway, it seems to be a bad limitation that flying monsters cannot
>
steal; so I've patched pick_up() to allow pickup by flying monsters. The
>
patch follows the end of this email. Levitating players still cannot
>
pick up objects (and cannot steal either---not sure if that's a bug or a
>
feature), but now flying monsters can pick up stuff and steal as well. I
>
thought I'd bring it up for discussion before checking it into CVS.
I'm a little concerned on that - I'm not sure, but there could be some
monsters out there that have flying set, that you really don't want picking
something up. I'd be reluctant to make such a change due to possible
undesirable side effects.
_______________________________________________
crossfire-devel mailing list
crossfire-devel at lists.real-time.com
https://mailman.real-time.com/mailman/listinfo/crossfire-devel
More information about the crossfire
mailing list