[crossfire] Pickup Drop Event expansion
Brendan Lally
brenlally at gmail.com
Thu Apr 29 09:48:31 CDT 2010
Hi All,
Quite a minor patch this, but one that has an impact on script/map
compatibility, so I figure it should probably go here.
https://sourceforge.net/tracker/?group_id=13833&atid=313833
This patch changes the meaning of the return types from event_pickup
and event_drop.
The initial motivation for this was in developing an implementation of
draughts (something which is still at quite an early stage) and needing
to be able to prevent an item from being picked up under certain
conditions (ie by the player playing the other colour). The current
behaviour of event pickup isn't helpful for this because the item
disappears if the pickup fails.
So what I have done is altered the meaning of the return values, rather
than 0 meaning 'item may be picked up' and non-zero meaning 'item may
not be picked up' I have 0 meaning 'item may be picked up' negative
meaning 'item will disappear rather than being picked up' and positive
meaning 'item will stay where it is'
Because picking up and dropping items are opposing actions, it follows
that they should have the same relative meaning for their return types,
hence event_drop is altered too.
The only immediate effects of this will be to give a cleaner way for
QuestEssentialUntil.py to handle item dropping (returning negative and
writing a custom message rather than setting start equip and showing
the default 'the gods who lent it to you' message) Although I think
navar_midane_pickup.py might need amended also, and possibly also
cf_darcap.
Brendan.
More information about the crossfire
mailing list