Cleanup that was missed during the last sweep. (#14)
This commit is contained in:
parent
5cf37da625
commit
01d0fb75b8
9 changed files with 93 additions and 111 deletions
|
|
@ -83,11 +83,7 @@ namespace Server.Items
|
|||
list.Add(1060738, worth); // value: ~1_val~
|
||||
}
|
||||
|
||||
#if NEWPARENT
|
||||
public override void OnAdded(IEntity parent)
|
||||
#else
|
||||
public override void OnAdded(object parent)
|
||||
#endif
|
||||
{
|
||||
base.OnAdded(parent);
|
||||
|
||||
|
|
@ -98,7 +94,8 @@ namespace Server.Items
|
|||
|
||||
Container root = parent as Container;
|
||||
|
||||
while (root?.Parent is Container) root = (Container)root.Parent;
|
||||
while (root?.Parent is Container container)
|
||||
root = container;
|
||||
|
||||
parent = root ?? parent;
|
||||
|
||||
|
|
@ -247,4 +244,4 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,11 +44,7 @@ namespace Server.Items
|
|||
UpdateTotal(this, TotalType.Gold, newValue - oldValue);
|
||||
}
|
||||
|
||||
#if NEWPARENT
|
||||
public override void OnAdded(IEntity parent)
|
||||
#else
|
||||
public override void OnAdded(object parent)
|
||||
#endif
|
||||
{
|
||||
base.OnAdded(parent);
|
||||
|
||||
|
|
@ -59,7 +55,8 @@ namespace Server.Items
|
|||
|
||||
Container root = parent as Container;
|
||||
|
||||
while (root?.Parent is Container) root = (Container)root.Parent;
|
||||
while (root?.Parent is Container container)
|
||||
root = container;
|
||||
|
||||
parent = root ?? parent;
|
||||
|
||||
|
|
@ -127,4 +124,4 @@ namespace Server.Items
|
|||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue