Raised This Month: $ Target: $400
 0% 

error 117: enum structs cannot be indexed as arrays


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
enderandrew
Senior Member
Join Date: Jun 2020
Old 07-10-2020 , 22:09   error 117: enum structs cannot be indexed as arrays
Reply With Quote #1

So I'm not really a developer by trade. I took a few programming courses 25 years ago and haven't really done any serious coding since then.

I'm not sure which language Sourcepawn is closest to, but I'm tempted to pick up a decent beginner programming book and learning it properly. For the moment I'm dipping my toes in the water and trying to learn basics by updating many of the plugins I'm currently testing to new syntax. I've updated dozens with no issues. Then I tried to tackle STAMM, which is 45 plugins plus various includes. And of that project, I can get 44 out of 45 to compile just with #pragma newdecls required.

But I'm struggling to update cstrike_weapons.inc for some reason.

Here is that include file as I've attempted to update it:

https://pastebin.com/rrfnhPsY

Code:
SourcePawn Compiler 1.10.0.6490
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2018 AlliedModders LLC

C:\tf2_server\tf\addons\sourcemod\scripting\include\cstrike_weapons.inc(231) : error 117: enum structs cannot be indexed as arrays
C:\tf2_server\tf\addons\sourcemod\scripting\include\cstrike_weapons.inc(309) : error 117: enum structs cannot be indexed as arrays
C:\tf2_server\tf\addons\sourcemod\scripting\include\cstrike_weapons.inc(314) : error 117: enum structs cannot be indexed as arrays
stamm_no_restrict.sp(37) : warning 241: Array-based enum structs will be removed in 1.11. See https://wiki.alliedmods.net/SourcePawn_Transitional_Syntax#Enum_Structs

3 Errors.
Three three errors are similiar lines:

SetTrieArray(hWeaponInfoTrie, weaponNames[WeaponID:i] , info[0], _:WeaponInfo);

As for that warning, I've converted other enums to enum structs, but stamm_no_restrict.sp(37) is referencing enum WeaponID which looks to have fixed values and shouldn't need to be a struct as far as I can tell, and I attempt to change it to an enum struct then a lot more breaks.
enderandrew is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode