Pushing result of GetDefaultByType into array causes 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: Pushing result of GetDefaultByType into array causes crash.

Re: Pushing result of GetDefaultByType into array causes cra

by Graf Zahl » Fri Jun 12, 2020 9:01 am

The example is fine. This should have aborted at compile time for a type mismatch, but the compiler does not catch this particular one.

Pushing result of GetDefaultByType into array causes crash.

by Accensus » Wed Jun 10, 2020 2:27 pm

Tested with GZDoom 4.4.1 x64.

The title may be misleading due to character limit. The array is a class array.

Can be reproduced like this:
1. Get Bullet-Eye (that's where I discovered it; guaranteed to crash)
2. Open the mod and navigate to ZActors/Weapons/BEWeaponBase.zsc, Line 345. Where it says

Code: Select all

PickedWeapons.Push(CurrWeapon.GetClass());
change that to

Code: Select all

PickedWeapons.Push(CurrWeapon);
then start a new game, type "summon newweaponcapsule", and shoot it. It will immediately crash to desktop.

I could try to cook up a smaller example if deemed necessary.

Top