diff --git a/HKMP/Animation/Effects/DashSlash.cs b/HKMP/Animation/Effects/DashSlash.cs index a42bdce..5e644f7 100644 --- a/HKMP/Animation/Effects/DashSlash.cs +++ b/HKMP/Animation/Effects/DashSlash.cs @@ -61,14 +61,13 @@ public override void Play(GameObject playerObject, bool[] effectInfo) { dashSlash.LocateMyFSM("Control Collider").SetState("Init"); var damage = ServerSettings.DashSlashDamage; - if (ServerSettings.IsPvpEnabled) { + if (ServerSettings.IsPvpEnabled && ShouldDoDamage) { // Somehow adding a DamageHero component or the parry FSM simply to the dash slash object doesn't work, // so we create a separate object for it var dashSlashCollider = Object.Instantiate( new GameObject( "DashSlashCollider", - typeof(PolygonCollider2D), - typeof(DamageHero) + typeof(PolygonCollider2D) ), dashSlash.transform ); @@ -83,8 +82,8 @@ public override void Play(GameObject playerObject, bool[] effectInfo) { AddParryFsm(dashSlashCollider); } - if (ShouldDoDamage && damage != 0) { - dashSlashCollider.GetComponent().damageDealt = damage; + if (damage != 0) { + dashSlashCollider.AddComponent().damageDealt = damage; } } diff --git a/HKMP/Animation/Effects/GreatSlash.cs b/HKMP/Animation/Effects/GreatSlash.cs index 0f98145..7a8f2ef 100644 --- a/HKMP/Animation/Effects/GreatSlash.cs +++ b/HKMP/Animation/Effects/GreatSlash.cs @@ -47,12 +47,12 @@ public override void Play(GameObject playerObject, bool[] effectInfo) { greatSlash.LocateMyFSM("Control Collider").SetState("Init"); var damage = ServerSettings.GreatSlashDamage; - if (ServerSettings.IsPvpEnabled) { + if (ServerSettings.IsPvpEnabled && ShouldDoDamage) { if (ServerSettings.AllowParries) { AddParryFsm(greatSlash); } - if (ShouldDoDamage && damage != 0) { + if (damage != 0) { greatSlash.AddComponent().damageDealt = damage; } } diff --git a/HKMP/Animation/Effects/SlashBase.cs b/HKMP/Animation/Effects/SlashBase.cs index 0e2c79e..334ed54 100644 --- a/HKMP/Animation/Effects/SlashBase.cs +++ b/HKMP/Animation/Effects/SlashBase.cs @@ -181,12 +181,12 @@ protected void Play(GameObject playerObject, bool[] effectInfo, GameObject prefa } var damage = ServerSettings.NailDamage; - if (ServerSettings.IsPvpEnabled) { + if (ServerSettings.IsPvpEnabled && ShouldDoDamage) { if (ServerSettings.AllowParries) { AddParryFsm(slash); } - if (ShouldDoDamage && damage != 0) { + if (damage != 0) { slash.AddComponent().damageDealt = damage; } }