[crossfire] Exiting shops with unpaid items

Nicolas Weeger (Laposte) nicolas.weeger at laposte.net
Sun Jul 9 04:44:21 CDT 2006


Hello.

In relation to 
https://sourceforge.net/tracker/index.php?func=detail&aid=1519089&group_id=13833&atid=113833

The bug is pretty easy: server/shop.c:can_pay doesn't go into containers to 
check for unpaid items, whereas get_payment does - thus player doesn't pay 
but does exit.

I see two fixes for that:
* make can_pay recursively check containers
* don't allow unpaid items to enter containers and stay in "main" inventory

I prefer the 2nd solution, as this way it's easy to drop items you couldn't 
pay. Drawback is that you can't buy an item you can't carry without any 
container (but i don't think that happens often ^_-), and you'll need to 
drop/pick bought items so they enter the container.

Nicolas



More information about the crossfire mailing list