ZScript allows pushing class instance to class type resulting in crash

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!

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is ON
[img] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: ZScript allows pushing class instance to class type resulting in crash

ZScript allows pushing class instance to class type resulting in crash

by Jekyll Grim Payne » Wed Nov 23, 2022 2:31 pm

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);
			}
		}
	}
}
Attachments
ArrayTypeCrash.pk3
(526 Bytes) Downloaded 26 times

Top