Pull Request
Finally. The complete and total separation of all state management in that god-forsaken piece of code is done.
DamageMobj now returns -1 for all cancelled damage, which means no state changes happen. 0 for normalcy, where pain flags can still apply.
Bonus: Modders have TriggerPainChance(Name mod, bool forcedPain) at their disposal now.
Graf: I have not deprecated ALLOW/CAUSEPAIN flags yet. With the code sorted out at last, and the flags still work, I think I found a nice balance where they won't be intrusive anymore without the need to remove their functionality.
If you still wish to see them removed, I can do that, but please consider a second look before deciding. It was the big elephant in the room, now it's the size of a cricket.
Anything else you want changed?
DamageMobj: The Big Stinker Refactor
Moderator: GZDoom Developers
- Major Cooke
- Posts: 8176
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49071
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: DamageMobj: The Big Stinker Refactor
This already looks a lot better than before.
One thing I'd like to change: Since the fallback in P_DamageMobj and the content of the scripted thunk are nearly identical it might be advisable to move this to a subfunction to reduce redundancy.
One thing I'd like to change: Since the fallback in P_DamageMobj and the content of the scripted thunk are nearly identical it might be advisable to move this to a subfunction to reduce redundancy.
- Major Cooke
- Posts: 8176
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: DamageMobj: The Big Stinker Refactor
Done! And thanks!
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49071
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: DamageMobj: The Big Stinker Refactor
I think it's ok, but I prefer to delay the merge until after the next release. This is nothing critical so I don't want to risk problems from this code not having been sufficiently tested.
- Major Cooke
- Posts: 8176
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: DamageMobj: The Big Stinker Refactor
Understandable, but just wanted to add that I've tested this on D4D and AEons of Death, both of which thoroughly use them.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49071
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: DamageMobj: The Big Stinker Refactor
Merged. I decided to get this in before the release.
- Major Cooke
- Posts: 8176
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: DamageMobj: The Big Stinker Refactor
Oh, nice! Thanks! This should be handy especially since now everyone has TriggerPainChance to play with.