Ensure pointers aren't used anymore when their parents are being deleted and they should be deleted themselves.

This commit is contained in:
2020-05-20 14:47:17 +02:00
parent 9bcfdf7791
commit eb99fc5661
9 changed files with 72 additions and 3 deletions

View File

@@ -63,6 +63,15 @@ namespace PkmnLibSharp.Library.Items
{
}
protected internal override void MarkAsDeleted()
{
base.MarkAsDeleted();
foreach (var item in _cache)
{
item.Value.MarkAsDeleted();
}
}
protected override void DeletePtr()
{
Creatureliblibrary.Generated.ItemLibrary.Destruct(Ptr);