We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a07f0d5 commit 4601f7fCopy full SHA for 4601f7f
GameServer/ECS-Components/Actions/NpcAttackAction.cs
@@ -45,7 +45,10 @@ public override bool OnOutOfRangeOrNoLosRangedAttack()
45
{
46
GameObject oldTarget = _target;
47
StandardMobBrain brain = _npcOwner.Brain as StandardMobBrain;
48
- brain.RemoveFromAggroList(_losCheckTarget as GameLiving);
+
49
+ if (_losCheckTarget is GameLiving livingLosCheckTarget)
50
+ brain.RemoveFromAggroList(livingLosCheckTarget);
51
52
brain.AttackMostWanted(); // This won't immediately start the attack on the new target, but we can use `TargetObject` to start checking it.
53
GameObject newTarget = _npcOwner.TargetObject;
54
0 commit comments