AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=58)
-   -   Declare arrays with using a variable for size (https://forums.alliedmods.net/showthread.php?t=335368)

kadet.89 11-29-2021 06:45

Declare arrays with using a variable for size
 
1 Attachment(s)
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?

Peace-Maker 11-29-2021 07:11

Re: Declare arrays with using a variable for size
 
Which compiler version and which runtime version are you using? There were fixes surrounding the sourcepawn heap recently in 1.11.

kadet.89 11-29-2021 08:28

Re: Declare arrays with using a variable for size
 
On my server: 1.11.0.6805
Compiller: 1.11 - build 6825

Peace-Maker 11-29-2021 09:35

Re: Declare arrays with using a variable for size
 
Try updating your server's sourcemod version. 6825 included related fixes.


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

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