ZScript allows pushing class instance to class type resulting in crash

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!
User avatar
Jekyll Grim Payne
Global Moderator
Posts: 1108
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)

ZScript allows pushing class instance to class type resulting in crash

Post by Jekyll Grim Payne »

This doesn't abort for some reason, leading to a hard crash when moving to the next map. Archive attached.

Code: Select all

class TestHandler : EventHandler
{
	array < Class<Weapon> > mapweapons;

	override void WorldThingSpawned(worldEvent e)
	{
		let weap = Weapon(e.thing);
		if (weap)
		{
			if (mapweapons.Find(weap) == mapweapons.Size())
			{
				mapweapons.Push(weap);
			}
		}
	}
}
You do not have the required permissions to view the files attached to this post.

Return to “Bugs [GZDoom]”