Skip to content

Commit

Permalink
Revert delimiting when exiting gpose
Browse files Browse the repository at this point in the history
  • Loading branch information
chirpxiv committed Jun 14, 2023
1 parent 0933ce5 commit 8e7d5da
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Ktisis/Camera/CameraService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Linq;
using System;
using System.Linq;
using System.Numerics;
using System.Collections.Generic;
using System.Collections.ObjectModel;
Expand All @@ -11,6 +12,7 @@

using Ktisis.Events;
using Ktisis.Interop.Hooks;
using Ktisis.Structs.FFXIV;

namespace Ktisis.Camera {
internal static class CameraService {
Expand Down Expand Up @@ -173,10 +175,18 @@ internal static void Dispose() {

// Events

private static void OnGPoseChange(bool state) {
private unsafe static void OnGPoseChange(bool state) {
if (state) PrepareCameraList();
CameraHooks.SetEnabled(state);
if (!state) DisposeCameras();
if (!state) {
DisposeCameras();

var active = (GPoseCamera*)Services.Camera->GetActiveCamera();
if (active != null) {
active->DistanceMax = 20;
active->Distance = Math.Clamp(active->Distance, 0, 20);
}
}
}

private unsafe static void PrepareCameraList() {
Expand Down

0 comments on commit 8e7d5da

Please sign in to comment.