Interkarma / daggerfall-unity

Open source recreation of Daggerfall in the Unity engine
http://www.dfworkshop.net
MIT License
2.7k stars 327 forks source link

Changing settings disables godmode #2602

Open John-Leitch opened 6 months ago

John-Leitch commented 6 months ago

Describe the issue

Pretty low severity, but filing just to put it out there. Godmode (tgm) is disabled controls are changed.

To Reproduce

Steps to reproduce the behavior:

  1. Enable godmode with the tgm console command.
  2. Navigate to Configure Advanced Controls.
  3. Change the Invert Look-Y setting.
  4. Observe that godmode is now disabled.

Expected behavior

It is expected that godmode remain enabled.

Screenshots and Logs

image

Screenshot showing tgm being used to set godmode to true multiple times in a row.

Desktop (please complete the following information):

Additional context

Discovered through chance while testing swimming after restarting and accidentally enabling Invert Look-Y. I haven't checked to see if this behavior is exhibited by changing other settings, or if it is specific to Invert Look-Y.

KABoissonneault commented 6 months ago

For some reason, many settings window call GameManager.Instance.StartGameBehaviour.ApplyStartSettings();, and doing so applies the StartGameBehaviour's GodMode settings to the player entity. Normally, this ApplyStartSettings is called on Start, and it makes sense that it would apply settings from the StartGameBehaviour.

The tgm cheat only modifies the Player's GodMode, so the StartGameBehaviour's GodMode stays false in a normal playthrough.

The fix should investigate why GameManager.Instance.StartGameBehaviour.ApplyStartSettings(); is called from DaggerfallJoystickControlsWindow and DaggerfallUnityMouseControlsWindow, and determine:

  1. Is this necessary?
  2. If so, provide an alternate version that only applies the new settings, not the "start game behaviour" settings