Remove combat mode component reference (#15206)
This commit is contained in:
@@ -8,6 +8,7 @@ namespace Content.Server.NPC.Systems;
|
||||
|
||||
public sealed partial class NPCCombatSystem
|
||||
{
|
||||
[Dependency] private readonly SharedCombatModeSystem _combat = default!;
|
||||
[Dependency] private readonly RotateToFaceSystem _rotate = default!;
|
||||
|
||||
// TODO: Don't predict for hitscan
|
||||
@@ -26,9 +27,9 @@ public sealed partial class NPCCombatSystem
|
||||
|
||||
private void OnRangedStartup(EntityUid uid, NPCRangedCombatComponent component, ComponentStartup args)
|
||||
{
|
||||
if (TryComp<SharedCombatModeComponent>(uid, out var combat))
|
||||
if (TryComp<CombatModeComponent>(uid, out var combat))
|
||||
{
|
||||
combat.IsInCombatMode = true;
|
||||
_combat.SetInCombatMode(uid, true, combat);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -38,9 +39,9 @@ public sealed partial class NPCCombatSystem
|
||||
|
||||
private void OnRangedShutdown(EntityUid uid, NPCRangedCombatComponent component, ComponentShutdown args)
|
||||
{
|
||||
if (TryComp<SharedCombatModeComponent>(uid, out var combat))
|
||||
if (TryComp<CombatModeComponent>(uid, out var combat))
|
||||
{
|
||||
combat.IsInCombatMode = false;
|
||||
_combat.SetInCombatMode(uid, false, combat);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +49,7 @@ public sealed partial class NPCCombatSystem
|
||||
{
|
||||
var bodyQuery = GetEntityQuery<PhysicsComponent>();
|
||||
var xformQuery = GetEntityQuery<TransformComponent>();
|
||||
var combatQuery = GetEntityQuery<SharedCombatModeComponent>();
|
||||
var combatQuery = GetEntityQuery<CombatModeComponent>();
|
||||
var query = EntityQueryEnumerator<NPCRangedCombatComponent, TransformComponent>();
|
||||
|
||||
while (query.MoveNext(out var uid, out var comp, out var xform))
|
||||
@@ -73,7 +74,7 @@ public sealed partial class NPCCombatSystem
|
||||
|
||||
if (combatQuery.TryGetComponent(uid, out var combatMode))
|
||||
{
|
||||
combatMode.IsInCombatMode = true;
|
||||
_combat.SetInCombatMode(uid, true, combatMode);
|
||||
}
|
||||
|
||||
if (!_gun.TryGetGun(uid, out var gunUid, out var gun))
|
||||
|
||||
Reference in New Issue
Block a user