From 0737416c017670aaa5db3bc4e83a9857befd4343 Mon Sep 17 00:00:00 2001 From: ryo_saeba Date: Sun, 29 May 2011 18:28:07 +0000 Subject: [PATCH] Ensure items were removed. git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@14501 282e977c-c81d-0410-88c4-b93c2d0d6712 --- python/dialog/post/takeitem.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/dialog/post/takeitem.py b/python/dialog/post/takeitem.py index b70bf0fc4..095e65a89 100644 --- a/python/dialog/post/takeitem.py +++ b/python/dialog/post/takeitem.py @@ -30,9 +30,11 @@ else: inv = character.CheckInventory(itemname) if inv: if quantity == 0: - CFItemBroker.Item(inv).subtract(inv.Quantity) + inv.Remove() else: - CFItemBroker.Item(inv).subtract(int(quantity)) + status = CFItemBroker.Item(inv).subtract(int(quantity)) + if status == 0: + Crossfire.Log(Crossfire.LogError, "Dialog script tried to remove more items than available from player %s" %(character.Name)) # we might have been wearing an item that was taken. character.Fix() else: