Skip to content

Commit

Permalink
fix: add FCVAR_LINKED_CONCOMMAND flag to new commands
Browse files Browse the repository at this point in the history
  • Loading branch information
roflmuffin committed Oct 18, 2023
1 parent 989d768 commit 35dc33b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions managed/CounterStrikeSharp.API/ConVarFlags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,21 @@ namespace CounterStrikeSharp.API
{
[Flags]
public enum ConVarFlags
{
{
None = 0,
Unregistered = (1 << 0),
DevelopmentOnly = (1 << 1),
Notify = (1 << 8),
Replicated = (1<<13)
Replicated = (1 << 13)
}
}

public enum ConCommandFlags
{
FCVAR_LINKED_CONCOMMAND = (1 << 0),

FCVAR_DEVELOPMENTONLY =
(1 << 1), // Hidden in released products. Flag is removed automatically if ALLOW_DEVELOPMENT_CVARS is defined.
FCVAR_GAMEDLL = (1 << 2), // defined by the game DLL
FCVAR_CLIENTDLL = (1 << 3), // defined by the client DLL
}
}
2 changes: 1 addition & 1 deletion managed/CounterStrikeSharp.API/Core/BasePlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public void AddCommand(string name, string description, CommandInfo.CommandCallb
});

var subscriber = new CallbackSubscriber(handler, wrappedHandler, () => { RemoveCommand(name, handler); });
NativeAPI.AddCommand(name, description, false, 0, subscriber.GetInputArgument());
NativeAPI.AddCommand(name, description, false, (int)ConCommandFlags.FCVAR_LINKED_CONCOMMAND, subscriber.GetInputArgument());
CommandHandlers[handler] = subscriber;
}

Expand Down

0 comments on commit 35dc33b

Please sign in to comment.