Skip to content

Commit

Permalink
Fix excessive collisions.
Browse files Browse the repository at this point in the history
  • Loading branch information
roncli committed Apr 1, 2021
1 parent 6334e14 commit 0bf248c
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions GameMod/MPSmash.cs
Expand Up @@ -58,17 +58,15 @@ class MPSmash_ProcessCollision {
switch (collision.collider.gameObject.layer) {
case 9:
var opponent = collision.collider.GetComponent<PlayerShip>();
if (opponent != null) {
if (__instance.m_charge_timer > 0f && __instance.c_rigidbody.velocity.magnitude > 2f && __instance.m_boosting) {
var di = new DamageInfo {
damage = (float)_PlayerShip_CalculateChargeAttackDamage_Method.Invoke(__instance, null),
owner = __instance.gameObject,
pos = __instance.transform.position,
type = DamageType.PLAYER_CHARGE,
weapon = ProjPrefab.none
};
opponent.ApplyDamage(di);
}
if (opponent != null && __instance.m_charge_timer > 0f && __instance.c_rigidbody.velocity.magnitude > 2f && __instance.m_boosting) {
var di = new DamageInfo {
damage = (float)_PlayerShip_CalculateChargeAttackDamage_Method.Invoke(__instance, null),
owner = __instance.gameObject,
pos = __instance.transform.position,
type = DamageType.PLAYER_CHARGE,
weapon = ProjPrefab.none
};
opponent.ApplyDamage(di);

__instance.CallRpcDoChargeAttackFinish();
__instance.m_charge_timer = 0f;
Expand Down

0 comments on commit 0bf248c

Please sign in to comment.