DamageMobj: The Big Stinker Refactor

Moderator: GZDoom Developers

Post Reply
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

DamageMobj: The Big Stinker Refactor

Post by Major Cooke »

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?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: DamageMobj: The Big Stinker Refactor

Post by Graf Zahl »

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.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: DamageMobj: The Big Stinker Refactor

Post by Major Cooke »

Done! And thanks!
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: DamageMobj: The Big Stinker Refactor

Post by Graf Zahl »

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.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: DamageMobj: The Big Stinker Refactor

Post by Major Cooke »

Understandable, but just wanted to add that I've tested this on D4D and AEons of Death, both of which thoroughly use them.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: DamageMobj: The Big Stinker Refactor

Post by Graf Zahl »

Merged. I decided to get this in before the release.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: DamageMobj: The Big Stinker Refactor

Post by Major Cooke »

Oh, nice! Thanks! This should be handy especially since now everyone has TriggerPainChance to play with. :D
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”