fix: Fixes FindItemsByType<T> that block recursion (#1453)

This commit is contained in:
Stefano Merotta 2023-08-13 00:37:13 +02:00 committed by GitHub
parent 455b11de9c
commit 431e7fb8fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -418,10 +418,10 @@ public class Container : Item
{ {
return type switch return type switch
{ {
TotalType.Gold => m_TotalGold, TotalType.Gold => m_TotalGold,
TotalType.Items => m_TotalItems, TotalType.Items => m_TotalItems,
TotalType.Weight => m_TotalWeight, TotalType.Weight => m_TotalWeight,
_ => base.GetTotal(type) _ => base.GetTotal(type)
}; };
} }
@ -1732,7 +1732,8 @@ public class Container : Item
{ {
items.Add(typedItem); items.Add(typedItem);
} }
else if (recurse && item is Container itemContainer)
if (recurse && item is Container itemContainer)
{ {
queue.Enqueue(itemContainer); queue.Enqueue(itemContainer);
} }