Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PlayerTags] Edit enum to enum struct #359

Open
Hexer10 opened this issue Mar 18, 2020 · 1 comment
Open

[PlayerTags] Edit enum to enum struct #359

Hexer10 opened this issue Mar 18, 2020 · 1 comment
Assignees

Comments

@Hexer10
Copy link
Collaborator

Hexer10 commented Mar 18, 2020

Right now the build on sm 1.11 fails:

Compile addons/sourcemod/scripting/MyJailbreak/playertags.sp
addons/sourcemod/scripting/MyJailbreak/playertags.sp(89) : error 101: specify either all dimensions or only the last dimension
addons/sourcemod/scripting/MyJailbreak/playertags.sp(90) : error 101: specify either all dimensions or only the last dimension
addons/sourcemod/scripting/MyJailbreak/playertags.sp(543) : error 163: indeterminate array size in "sizeof" expression (symbol "g_sStatsTag")
addons/sourcemod/scripting/MyJailbreak/playertags.sp(544) : error 163: indeterminate array size in "sizeof" expression (symbol "g_sStatsTag")
addons/sourcemod/scripting/MyJailbreak/playertags.sp(545) : error 163: indeterminate array size in "sizeof" expression (symbol "g_sStatsTag")
addons/sourcemod/scripting/MyJailbreak/playertags.sp(546) : error 163: indeterminate array size in "sizeof" expression (symbol "g_sStatsTag")
addons/sourcemod/scripting/MyJailbreak/playertags.sp(547) : error 163: indeterminate array size in "sizeof" expression (symbol "g_sStatsTag")
addons/sourcemod/scripting/MyJailbreak/playertags.sp(549) : error 163: indeterminate array size in "sizeof" expression (symbol "g_sChatTag")
addons/sourcemod/scripting/MyJailbreak/playertags.sp(550) : error 163: indeterminate array size in "sizeof" expression (symbol "g_sChatTag")
addons/sourcemod/scripting/MyJailbreak/playertags.sp(551) : error 163: indeterminate array size in "sizeof" expression (symbol "g_sChatTag")
addons/sourcemod/scripting/MyJailbreak/playertags.sp(552) : error 163: indeterminate array size in "sizeof" expression (symbol "g_sChatTag")
addons/sourcemod/scripting/MyJailbreak/playertags.sp(553) : error 163: indeterminate array size in "sizeof" expression (symbol "g_sChatTag")

The issue is in the following lines:
We should migrate the g_eROLES enum to an enum struct
https://github.com/shanapu/MyJailbreak/blob/master/addons/sourcemod/scripting/MyJailbreak/playertags.sp#L80-L87

Where it is used:
Declare the array using the enum struct as type.

char g_sChatTag[MAXPLAYERS + 1][g_eROLES][64];
char g_sStatsTag[MAXPLAYERS + 1][g_eROLES][64];

kvMenu.GetString("spectator_chat", g_sChatTag[client][SPECTATOR], sizeof(g_sChatTag), "");
kvMenu.GetString("warden_chat", g_sChatTag[client][WARDEN], sizeof(g_sChatTag), "");
kvMenu.GetString("deputy_chat", g_sChatTag[client][DEPUTY], sizeof(g_sChatTag), "");
kvMenu.GetString("guard_chat", g_sChatTag[client][GUARD], sizeof(g_sChatTag), "");
kvMenu.GetString("prisoner_chat", g_sChatTag[client][PRISONER], sizeof(g_sChatTag), "");

@Hexer10 Hexer10 self-assigned this Mar 19, 2020
Hexer10 added a commit that referenced this issue Mar 19, 2020
@Hexer10 Hexer10 closed this as completed Mar 19, 2020
@Hexer10 Hexer10 reopened this Mar 19, 2020
@Hexer10 Hexer10 added done in dev and removed todo labels Mar 19, 2020
@Hexer10
Copy link
Collaborator Author

Hexer10 commented Mar 19, 2020

Not tested but should work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant