fix(Core/Items): Special bags cannot be stored inside other special b… (#12032)

fix(Core/Items): Special bags cannot be stored inside other special bags.

Fixes #11946
This commit is contained in:
UltraNix
2022-06-18 19:46:00 +02:00
committed by GitHub
parent 2cde0c35ba
commit 0cf1303b9a
+22 -2
View File
@@ -183,10 +183,20 @@ bool ItemCanGoIntoBag(ItemTemplate const* pProto, ItemTemplate const* pBagProto)
switch (pBagProto->Class)
{
case ITEM_CLASS_CONTAINER:
{
if (pBagProto->SubClass == ITEM_SUBCLASS_CONTAINER)
{
return true;
}
else
{
if (pProto->Class == ITEM_CLASS_CONTAINER)
{
return false;
}
switch (pBagProto->SubClass)
{
case ITEM_SUBCLASS_CONTAINER:
return true;
case ITEM_SUBCLASS_SOUL_CONTAINER:
if (!(pProto->BagFamily & BAG_FAMILY_MASK_SOUL_SHARDS))
return false;
@@ -222,7 +232,15 @@ bool ItemCanGoIntoBag(ItemTemplate const* pProto, ItemTemplate const* pBagProto)
default:
return false;
}
}
}
case ITEM_CLASS_QUIVER:
{
if (pProto->Class == ITEM_CLASS_QUIVER)
{
return false;
}
switch (pBagProto->SubClass)
{
case ITEM_SUBCLASS_QUIVER:
@@ -237,6 +255,8 @@ bool ItemCanGoIntoBag(ItemTemplate const* pProto, ItemTemplate const* pBagProto)
return false;
}
}
}
return false;
}