Skip to content

Commit 44ce97f

Browse files
committed
cleanup resourceBase
1 parent 27dea25 commit 44ce97f

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

Intersect.Client.Core/Entities/Entity.cs

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2452,27 +2452,30 @@ public int IsTileBlocked(
24522452
switch (en.Value)
24532453
{
24542454
case Resource resource:
2455-
var resourceBase = resource.Descriptor;
2456-
if (resourceBase != null)
2455+
var resourceDescriptor = resource.Descriptor;
2456+
if (resourceDescriptor == null)
24572457
{
2458-
if (projectileTrigger)
2459-
{
2460-
bool isDead = resource.IsDead;
2461-
if (!ignoreAliveResources && !isDead || !ignoreDeadResources && isDead)
2462-
{
2463-
blockedBy = en.Value;
2464-
2465-
return -6;
2466-
}
2458+
break;
2459+
}
24672460

2461+
if (projectileTrigger)
2462+
{
2463+
bool isDead = resource.IsDead;
2464+
if ((ignoreAliveResources || isDead) && (ignoreDeadResources || !isDead))
2465+
{
24682466
return -1;
24692467
}
24702468

2471-
if (resourceBase.WalkableAfter && resource.IsDead ||
2472-
resourceBase.WalkableBefore && !resource.IsDead)
2473-
{
2474-
continue;
2475-
}
2469+
blockedBy = en.Value;
2470+
2471+
return -6;
2472+
2473+
}
2474+
2475+
if (resourceDescriptor.WalkableAfter && resource.IsDead ||
2476+
resourceDescriptor.WalkableBefore && !resource.IsDead)
2477+
{
2478+
continue;
24762479
}
24772480

24782481
break;

0 commit comments

Comments
 (0)