[Added] DamageMobj: The Big Stinker Refactor

Moderator: GZDoom Developers

DamageMobj: The Big Stinker Refactor

Postby Major Cooke » Wed Dec 12, 2018 10:54 pm

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
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: DamageMobj: The Big Stinker Refactor

Postby Graf Zahl » Thu Dec 13, 2018 1:30 am

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
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: DamageMobj: The Big Stinker Refactor

Postby Major Cooke » Thu Dec 13, 2018 2:31 am

Done! And thanks!
User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: DamageMobj: The Big Stinker Refactor

Postby Graf Zahl » Fri Dec 14, 2018 2:02 pm

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
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: DamageMobj: The Big Stinker Refactor

Postby Major Cooke » Mon Dec 17, 2018 10:54 am

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
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: DamageMobj: The Big Stinker Refactor

Postby Graf Zahl » Wed Dec 26, 2018 5:56 am

Merged. I decided to get this in before the release.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: DamageMobj: The Big Stinker Refactor

Postby Major Cooke » Wed Dec 26, 2018 12:27 pm

Oh, nice! Thanks! This should be handy especially since now everyone has TriggerPainChance to play with. :D
User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: Trendiction.de [Bot] and 1 guest