Skip to content

Commit bb9b82b

Browse files
author
Y_Less
committed
Hack a solution to the extra long y_commands function names.
1 parent 91c9ccc commit bb9b82b

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

YSI_Visual/y_commands/y_commands_entry.inc

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,37 @@ Optional plugins:
9393
#include "..\..\YSI_Server\y_punycode"
9494

9595
// Include the group functions (maybe).
96-
#define Y_COMMANDS_GROUP_NAME<%0...%1> %0Command%1
96+
#define Y_COMMANDS_GROUP_NAME<%0...%1> %0YCMD%1
9797
#define Y_COMMANDS_GROUP_LIMIT MAX_COMMANDS
9898
#define Y_COMMANDS_GROUP_TAG _
99+
100+
// The one external function that we need to rename
101+
#define YCMD_SetPlayer Command_SetPlayer
99102
#include "..\..\YSI_Players\y_groups\y_groups__include"
103+
#undef YCMD_SetPlayer
104+
105+
// Redefine the new names back to the old names.
106+
#define Command_InitialiseFromGroups YCMD_InitialiseFromGroups
107+
#define Group_SetCommand Group_SetYCMD
108+
#define Group_CommandAllowed Group_YCMDAllowed
109+
#define Group_CommandDenied Group_YCMDDenied
110+
#define Group_GetCommand Group_GetYCMD
111+
#define Group_SetCommandDefault Group_SetYCMDDefault
112+
#define Group_SetCommandNew Group_SetYCMDNew
113+
#define Group_ExclusiveCommand Group_ExclusiveYCMD
114+
#define Iter_Func@Group_Command Iter_Func@Group_YCMD
115+
#define Iterator@Group_Command Iterator@Group_YCMD
116+
#define iterstart@Group_Command iterstart@Group_YCMD
117+
#define Group_SetGlobalCommand Group_SetGlobalYCMD
118+
#define Group_GlobalCommandAllowed Group_GlobalYCMDAllowed
119+
#define Group_GlobalCommandDenied Group_GlobalYCMDDenied
120+
#define Group_GetGlobalCommand Group_GetGlobalYCMD
121+
#define Group_SetGlobalCommandDefault Group_SetGlobalYCMDDefault
122+
#define Group_SetGlobalCommandNew Group_SetGlobalYCMDNew
123+
#define Group_GlobalExclusiveCommand Group_GlobalExclusiveYCMD
124+
#define Iter_Func@Group_GlobalCommand Iter_Func@Group_GlobalYCMD
125+
#define Iterator@Group_GlobalCommand Iterator@Group_GlobalYCMD
126+
#define iterstart@Group_GlobalCommand iterstart@Group_GlobalYCMD
100127

101128
// Set commands as master 51.
102129
#define MASTER 51

YSI_Visual/y_commands/y_commands_impl.inc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -967,12 +967,13 @@ GLOBAL__ Command_GetCurrent()
967967
*
968968
* native Command_GetPlayerCommandCount(playerid);
969969
*
970+
* Has an internal name and an external name, because macros.
970971
* </remarks>
971972
*//*------------------------------------------------------------------------**/
972973

973-
FOREIGN__ Command_GetPlayerCommandCount(playerid);
974+
FOREIGN__ YCMD_GetPlayerCommandCount(playerid);
974975

975-
GLOBAL__ Command_GetPlayerCommandCount(playerid)
976+
GLOBAL__ YCMD_GetPlayerCommandCount(playerid)
976977
{
977978
P:2("Command_GetPlayerCommandCount called: %i", playerid);
978979
new
@@ -989,6 +990,8 @@ GLOBAL__ Command_GetPlayerCommandCount(playerid)
989990
return count;
990991
}
991992

993+
#define Command_GetPlayerCommandCount YCMD_GetPlayerCommandCount
994+
992995
/*
993996
994997
888b 88

0 commit comments

Comments
 (0)