28fd27d21d
* Added a proper, way more reliable fall damage removal feature * Added an experimental 'smarter' fall damage prevention feature * Refactored all setting labels for better readability
28 lines
691 B
C#
28 lines
691 B
C#
using System.Reflection;
|
|
using Aki.Reflection.Patching;
|
|
using Comfort.Common;
|
|
using EFT;
|
|
using HarmonyLib;
|
|
|
|
namespace Terkoiz.Freecam
|
|
{
|
|
public class FreecamPatch : ModulePatch
|
|
{
|
|
protected override MethodBase GetTargetMethod()
|
|
{
|
|
return AccessTools.Method(typeof(GameWorld), "OnGameStarted");
|
|
}
|
|
|
|
[PatchPostfix]
|
|
public static void PatchPostFix()
|
|
{
|
|
var gameworld = Singleton<GameWorld>.Instance;
|
|
|
|
if (gameworld == null)
|
|
return;
|
|
|
|
// Add FreeCamController to GameWorld GameObject
|
|
gameworld.gameObject.AddComponent<FreecamController>();
|
|
}
|
|
}
|
|
} |