mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2024-12-29 03:28:26 +00:00
add planet teleporting check back
This commit is contained in:
parent
04432676dd
commit
4aef732440
27
QSB/TeleportingPlanetsPatch.cs
Normal file
27
QSB/TeleportingPlanetsPatch.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using HarmonyLib;
|
||||
using OWML.Common;
|
||||
using QSB.Patches;
|
||||
using QSB.Utility;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace QSB;
|
||||
|
||||
/// <summary>
|
||||
/// TEMPORARY: this is for trying to solve this stupid fucking bug (gorp)
|
||||
/// </summary>
|
||||
[HarmonyPatch(typeof(OWRigidbody))]
|
||||
public class TeleportingPlanetsPatch : QSBPatch
|
||||
{
|
||||
public override QSBPatchTypes Type => QSBPatchTypes.OnModStart;
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(nameof(OWRigidbody.SetPosition))]
|
||||
private static void SetPosition(OWRigidbody __instance, Vector3 worldPosition)
|
||||
{
|
||||
if (__instance.TryGetComponent<AstroObject>(out var astroObject) && astroObject._name != AstroObject.Name.ProbeCannon)
|
||||
{
|
||||
DebugLog.ToAll($"AHHHHHHHHH!!!!!!!!!\n{Environment.StackTrace}", MessageType.Error);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user