Raised This Month: $32 Target: $400
 8% 

Array of Struct in Struct


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
UeberDaniel
AlliedModders Donor
Join Date: Dec 2009
Location: Germany
Old 01-19-2020 , 07:04   Array of Struct in Struct
Reply With Quote #1

Hi,
why is this not working?
PHP Code:
enum struct WeaponBuffer{
    
int dropTime;
    
int droppedPropId;
    
char className[64];
    
char weaponName[64];
}

enum struct PlayerWeaponBuffer{
    
int Player;
    
int deathTime;
    
int nextBuffer;
    
WeaponBuffer WB[4];
}

PlayerWeaponBuffer clientWeapons[MAXPLAYERS 1]; 
on Line "WeaponBuffer WB[4]" i get this Error: : error 065: enum struct fields cannot have more than one Dimension

Where is the sense behind structs if it has so many limitations?
also ref: https://forums.alliedmods.net/showthread.php?t=320847
__________________


Last edited by UeberDaniel; 01-19-2020 at 07:06.
UeberDaniel is offline
Send a message via MSN to UeberDaniel
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 01-19-2020 , 08:24   Re: Array of Struct in Struct
Reply With Quote #2

Quote:
Originally Posted by Dany666 View Post
Where is the sense behind structs if it has so many limitations?
This is one of the main reasons they use "enum struct" instead of "struct" - the struct-like syntax is just syntactic sugar a pre-existing feature with many limitations.
__________________
asherkin is offline
Reply



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 23:25.


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