MTrop / DoomTools

Doom-related tools for Java. Home of DECOHack and lots of other utilities. Build WAD projects (and soon, other kinds) with ease!
https://mtrop.github.io/DoomTools/
MIT License
46 stars 5 forks source link

[DECOHack] "Safe" Freeing of States from a Starting Label #80

Open MTrop opened 2 years ago

MTrop commented 2 years ago

So, DECOHack's state freeing is a tad... overzealous, let's say.

There needs to be a way to safely free a state on a weapon or thing such that it doesn't "overfree" what is expected, despite it being the intended behavior.

A new clause keyword may be in order. Something like:

weapon WP_PISTOL only free Label

Or somesuch language to convey that it should only free that state until it hits a state that has a defined label. Will a reverse lookup need to be in order?

This may turn into a bit of a complicated issue, unfortunately, as the traverser only can see the next state via indexes, not labels. A quick scan may need to be in order at startup to set these up, if not baked into code, initially.

MTrop commented 2 years ago

A small bandage for the reason for this enhancement was added in commit aa3016f2064f06a08b3df264dc778a81fff4bf3d.

This kinda puts this issue in low priority, because the solution appears to be a lot more complicated than I think it is.