mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-26 18:35:34 +00:00
disable collision from triggering impact code on clients
This commit is contained in:
parent
5f5e04e29f
commit
51402612a1
@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using OWML.Common;
|
|
||||||
using QSB.MeteorSync.WorldObjects;
|
using QSB.MeteorSync.WorldObjects;
|
||||||
using QSB.Patches;
|
using QSB.Patches;
|
||||||
using QSB.Utility;
|
using QSB.Utility;
|
||||||
@ -105,6 +104,13 @@ namespace QSB.MeteorSync.Patches
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[HarmonyPrefix]
|
||||||
|
[HarmonyPatch(typeof(MeteorController), nameof(MeteorController.OnCollisionEnter))]
|
||||||
|
public static bool OnCollisionEnter(MeteorController __instance,
|
||||||
|
Collision collision)
|
||||||
|
=> false;
|
||||||
|
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(MeteorController), nameof(MeteorController.Impact))]
|
[HarmonyPatch(typeof(MeteorController), nameof(MeteorController.Impact))]
|
||||||
public static bool Impact(MeteorController __instance,
|
public static bool Impact(MeteorController __instance,
|
||||||
|
@ -43,8 +43,6 @@ namespace QSB.MeteorSync.WorldObjects
|
|||||||
impactPoint = Locator._brittleHollow.transform.TransformPoint(impactPoint);
|
impactPoint = Locator._brittleHollow.transform.TransformPoint(impactPoint);
|
||||||
Damage = damage;
|
Damage = damage;
|
||||||
|
|
||||||
AttachedObject.transform.position = impactPoint;
|
|
||||||
|
|
||||||
var hits = Physics.OverlapSphere(impactPoint, 1, OWLayerMask.physicalMask, QueryTriggerInteraction.Ignore);
|
var hits = Physics.OverlapSphere(impactPoint, 1, OWLayerMask.physicalMask, QueryTriggerInteraction.Ignore);
|
||||||
var obj = hits
|
var obj = hits
|
||||||
.Select(x => x.gameObject)
|
.Select(x => x.gameObject)
|
||||||
@ -56,6 +54,7 @@ namespace QSB.MeteorSync.WorldObjects
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AttachedObject.owRigidbody.MoveToPosition(impactPoint);
|
||||||
var impactVel = AttachedObject.owRigidbody.GetVelocity() - obj.GetAttachedOWRigidbody().GetVelocity();
|
var impactVel = AttachedObject.owRigidbody.GetVelocity() - obj.GetAttachedOWRigidbody().GetVelocity();
|
||||||
AttachedObject.Impact(obj, impactPoint, impactVel);
|
AttachedObject.Impact(obj, impactPoint, impactVel);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user