Raised This Month: $12 Target: $400
 3% 

Declare arrays with using a variable for size


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 11-29-2021 , 06:45   Declare arrays with using a variable for size
Reply With Quote #1

I use emitsoundany.inc include in my plugin.
If I build it with 1.10, there are no problems.
If I build it with 1.11, when I run the plugin I get an error in line 150:
HTML Code:
Exception reported: Tracker stack is out of bounds
I see that the array size is set to a variable, the value of which is probably not known at compile time. So if I replace this line with this:
PHP Code:
int clients[MAXPLAYERS+1]; 
There is no error when I run the plugin.
As this is allowed to use variables, can I know at compile time when an array size initialised with a variable will be giving this error?
Attached Files
File Type: zip emitsoundany.zip (1.9 KB, 46 views)

Last edited by kadet.89; 11-29-2021 at 08:30.
kadet.89 is offline
Send a message via Skype™ to kadet.89
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 11-29-2021 , 07:11   Re: Declare arrays with using a variable for size
Reply With Quote #2

Which compiler version and which runtime version are you using? There were fixes surrounding the sourcepawn heap recently in 1.11.
__________________
Peace-Maker is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 11-29-2021 , 08:28   Re: Declare arrays with using a variable for size
Reply With Quote #3

On my server: 1.11.0.6805
Compiller: 1.11 - build 6825
kadet.89 is offline
Send a message via Skype™ to kadet.89
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 11-29-2021 , 09:35   Re: Declare arrays with using a variable for size
Reply With Quote #4

Try updating your server's sourcemod version. 6825 included related fixes.
__________________
Peace-Maker is offline
Reply


Thread Tools
Display Modes

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 08:56.


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