Dynamic Array of an Array

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
XxMiltenXx
Posts: 219
Joined: Wed Jan 08, 2014 8:40 am
Graphics Processor: nVidia with Vulkan support
Location: Germany

Dynamic Array of an Array

Post by XxMiltenXx »

I was trying out to make a dynamic array of an array.
The declration of it works fine, however I ran into a strange issue.

Code: Select all

version "3.3"

Class MyDoomPlayer : DoomPlayer
{
	Array<double> MyArray[MAXPLAYERS];

	override void Tick()
	{
		int playerNum = PlayerNumber();
		For (int i = 0; i < MyArray.Size(); i++)
		{
			MyArray[playerNum][i] = 2;
		}
		MyArray[playerNum].Push(4);
		Super.Tick();
	}
}
If I try to start the GZDoom with it, I will get the following error message:

Code: Select all

Script error, "InvalidResizableArray.pk3:zscript.txt" line 12:
Invalid resizable array
Line 12 is this:

Code: Select all

MyArray[playerNum][i] = 2;
However, if I replace "playerNum" with any number between 0 and 7, it will work fine. I only get the error message when I use the variable instead.
Attachments
InvalidResizableArray.pk3
(317 Bytes) Downloaded 47 times
Post Reply

Return to “Closed Bugs [GZDoom]”