ZDoom / gzdoom

GZDoom is a feature centric port for all Doom engine games, based on ZDoom, adding an OpenGL renderer and powerful scripting capabilities
http://zdoom.org
GNU General Public License v3.0
2.55k stars 552 forks source link

[BUG] DSDHACKED things appearing as unknown things in GZDoom #2619

Open rakohus opened 4 months ago

rakohus commented 4 months ago

GZDoom version

g4.12.2

Which game are you running with GZDoom?

Doom 2

What Operating System are you using?

Windows 10

Please describe your specific OS version

Win 10

Relevant hardware info

N/A

Have you checked that no other similar issue already exists?

A clear and concise description of what the bug is.

While implementing dsdhacked support in Odamex, I was using dsda and gz as references for behavior and noticed this. I pulled these things straight out of Eviternity 2 for testing. They appear correctly in Eviternity 2 RC5 across both ports.

In the supplied wad, they only spawn in dsdadoom. In gz, they appear as the unknown <!> thing.

Steps to reproduce the behaviour.

Run the supplied wad. ev2dsd.zip

Your configuration

No response

Provide a Log

No response

tomas7770 commented 2 months ago

I'm not too familiar with GZDoom's code, but from what I could figure out, the problem seems to be that PClassActor::StaticInit - the function that fills PClassActor::AllActorClasses - is called before DeHacked patches are loaded.

The new classes defined in the patch aren't added to PClassActor::AllActorClasses, and in turn RegisterIDs() isn't called for them, so they aren't added to DoomEdMap, preventing them from spawning in maps (though the classes exist and can be summoned through the console).