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