From 4839e2dcdf24fca21aa27b9b5a0f5d1bfd816b2b Mon Sep 17 00:00:00 2001 From: Dillon Skaggs Date: Tue, 16 Apr 2024 14:15:51 -0500 Subject: [PATCH] fix(mono-v2): disallow KeyMap to be used on RedM - keymap natives are not currently supported by RedM, using these would result in RedM crashing --- code/client/clrcore-v2/Attributes.cs | 5 +++-- code/client/clrcore-v2/BaseScript.cs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/code/client/clrcore-v2/Attributes.cs b/code/client/clrcore-v2/Attributes.cs index c7faa66c28..a4939668e2 100644 --- a/code/client/clrcore-v2/Attributes.cs +++ b/code/client/clrcore-v2/Attributes.cs @@ -58,13 +58,14 @@ public CommandAttribute(string command, bool restricted = false) } } -#if !IS_FXSERVER +// TODO: revert this commit (blame check) when RedM has KeyMapping support, also don't make changes to this comment. +#if GTA_FIVE /// /// Register this method to listen for the given key when this is loaded /// /// This will bind the given input details to the command, triggering all commands registered as such.
Only works on inherited class methods
#else - /// Does nothing on server side + /// Does nothing on server side or RedM [EditorBrowsable(EditorBrowsableState.Never)] #endif [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] diff --git a/code/client/clrcore-v2/BaseScript.cs b/code/client/clrcore-v2/BaseScript.cs index cc604661ec..bb08515137 100644 --- a/code/client/clrcore-v2/BaseScript.cs +++ b/code/client/clrcore-v2/BaseScript.cs @@ -273,7 +273,7 @@ internal void RegisterCommand(string command, DynFunc dynFunc, bool isRestricted internal void RegisterKeyMap(string command, string description, string inputMapper, string inputParameter, DynFunc dynFunc) { -#if IS_FXSERVER +#if !GTA_FIVE throw new NotImplementedException(); #else if (inputMapper != null && inputParameter != null)