Configuration for effect not being used with RustFixed

 

Starting at line 316:

        private void OnPlayerMetabolize(PlayerMetabolism metabolism, BasePlayer basePlayer)
        {
            if (basePlayer != null && basePlayer.IPlayer.HasPermission(permFrozen))
            {
                metabolism.temperature.SetValue(-50f);
                basePlayer.metabolism.SendChangesToClient();

                Vector3 breathPosition = basePlayer.eyes.position + Quaternion.Euler(basePlayer.serverInput.current.aimAngles) * new Vector3(0, 0, 0.2f);
                Effect.server.Run("assets/bundled/prefabs/fx/player/frosty_breath.prefab", breathPosition);
            }
        }

 

Suggested changes:

        private void OnPlayerMetabolize(PlayerMetabolism metabolism, BasePlayer basePlayer)
        {
            if (basePlayer != null && basePlayer.IPlayer.HasPermission(permFrozen))
            {
                if (config.EnableEffect)
                {
                    metabolism.temperature.SetValue(-50f);
                    basePlayer.metabolism.SendChangesToClient();

                    Vector3 breathPosition = basePlayer.eyes.position + Quaternion.Euler(basePlayer.serverInput.current.aimAngles) * new Vector3(0, 0, 0.2f);
                    Effect.server.Run("assets/bundled/prefabs/fx/player/frosty_breath.prefab", breathPosition);
                }
            }
        }

 

This simple logic change will allow the config option ("Enable frozen effect") to function as intended. In the current state (v2.3.0) this option does nothing to change the function of the plugin, and so the effect is applied regardless of the settings of the config file. I took the liberty of patching it on my own end, but others might want this as well in the next version. Cheers Wulf!

Thanks! Why this still has not been implemented into the plugin????

NeXTA

Thanks! Why this still has not been implemented into the plugin????

Likely got missed, or lack of time; or both. ;)

You're welcome.

Updated in the latest version, but unsubscribing from the hook instead of the if check each call. Thanks!

Locked automatically