From 091b69500d039accb5380675e541b702f28fd538 Mon Sep 17 00:00:00 2001 From: Lightguard Date: Sun, 4 Jul 2010 22:39:24 +0200 Subject: [PATCH] [10151] Prevent autostoring not empty bags Thanks to The_Game_Master for detailed information about the bug. --- src/game/Player.cpp | 4 ++++ src/shared/revision_nr.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index f2e5ed57b..070de50b8 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -9925,6 +9925,10 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3 } } + // Normally it would be impossible to autostore not empty bags + if(pItem->IsBag() && !((Bag*)pItem)->IsEmpty()) + return EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG; + // search free slot res = _CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START,INVENTORY_SLOT_ITEM_END,dest,pProto,count,false,pItem,bag,slot); if (res!=EQUIP_ERR_OK) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index ae210f2c6..caf670361 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10150" + #define REVISION_NR "10151" #endif // __REVISION_NR_H__