Clean up: Bugs, LINQ, constructors, default values, and null checks (#18)
This commit is contained in:
parent
e748af4430
commit
513e54f70e
1094 changed files with 15913 additions and 21892 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
|
|
@ -80,21 +81,8 @@ namespace Server.Items
|
|||
|
||||
public void Refresh()
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
foreach (Mobile mob in GetMobilesInRange(CurrentRange))
|
||||
{
|
||||
if (mob.Hidden && mob.AccessLevel > AccessLevel.Player)
|
||||
continue;
|
||||
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (found)
|
||||
ItemID = ActiveItemID;
|
||||
else
|
||||
ItemID = InactiveItemID;
|
||||
bool found = GetMobilesInRange(CurrentRange).Any(mob => !mob.Hidden || mob.AccessLevel <= AccessLevel.Player);
|
||||
ItemID = found ? ActiveItemID : InactiveItemID;
|
||||
|
||||
Visible = ItemID != 0x1;
|
||||
}
|
||||
|
|
@ -141,4 +129,4 @@ namespace Server.Items
|
|||
Timer.DelayCall(TimeSpan.Zero, Refresh);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue