Fixes parent references. (#15)

This commit is contained in:
Kamron Batman 2019-03-03 15:40:17 -08:00 committed by GitHub
parent 01d0fb75b8
commit 90ffe0ea3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 55 additions and 93 deletions

View file

@ -79,7 +79,7 @@ namespace Server.SkillHandlers
{
Item stolen = null;
object root = toSteal.RootParent;
IEntity root = toSteal.RootParent;
Mobile mobRoot = root as Mobile;
StealableArtifactsSpawner.StealableInstance si = null;
@ -215,7 +215,7 @@ namespace Server.SkillHandlers
{
m_Thief.SendLocalizedMessage(502710); // You can't steal that!
}
else if (toSteal.LootType == LootType.Newbied || toSteal.CheckBlessed(root))
else if (toSteal.LootType == LootType.Newbied || toSteal.CheckBlessed(mobRoot))
{
m_Thief.SendLocalizedMessage(502710); // You can't steal that!
}
@ -244,7 +244,7 @@ namespace Server.SkillHandlers
{
m_Thief.SendLocalizedMessage(502710); // You can't steal that!
}
else if (mobRoot != null && !m_Thief.CanBeHarmful((Mobile)root))
else if (mobRoot != null && !m_Thief.CanBeHarmful(mobRoot))
{
}
else if (root is Corpse)
@ -332,7 +332,7 @@ namespace Server.SkillHandlers
from.RevealingAction();
Item stolen = null;
object root = null;
IEntity root = null;
bool caught = false;
if (target is Item item)
@ -356,7 +356,7 @@ namespace Server.SkillHandlers
{
m_Thief.SendLocalizedMessage(502710); // You can't steal that!
}
Mobile mobRoot = root as Mobile;
if (stolen != null)
@ -395,7 +395,7 @@ namespace Server.SkillHandlers
if (mobRoot?.Player == true && m_Thief is PlayerMobile pm &&
IsInnocentTo(pm, mobRoot) && !IsInGuild(mobRoot))
{
pm.PermaFlags.Add((Mobile)root);
pm.PermaFlags.Add(mobRoot);
pm.Delta(MobileDelta.Noto);
}
}
@ -484,4 +484,4 @@ namespace Server.SkillHandlers
}
}
}
}
}