DMG_TEST for DamageMobj
Moderator: GZDoom Developers
-
- Posts: 2383
- Joined: Thu Feb 11, 2016 9:59 am
DMG_TEST for DamageMobj
Following the train of thought here, the idea behind DMG_TEST (or DMG_NODAMAGE, whatever works) is to call Super.DamageMobj to get the final damage without doing any real health reduction. This way I can operate on the value after it's been modified by factors and whatnot, and use it in calculations separately from the damage argument, which is the raw value and often times useless to work with in my case. I can't assign the return of Super.DamageMobj to a variable and work with that because by that point it's already too late and the damage has already been dealt.
-
- Lead GZDoom+Raze Developer
- Posts: 49117
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: DMG_TEST for DamageMobj
This would require quite a bit of refactoring because DamageMobj is doing lots of stuff aside from calculating the damage - and it's not really doing things in an intuitive order.
-
- Posts: 2383
- Joined: Thu Feb 11, 2016 9:59 am
Re: DMG_TEST for DamageMobj
I was afraid of that. Hopefully it's feasible down the line and not completely out of the question because refactoring DamageMobj seems like a good idea. A lot of calculations regarding damage are located in there so selectively modifying behaviour mod-side is a pain in the ass. Probably one of the most crammed parts of the engine from what I can see. That and AActor::Tick(). 500 LOC functions seem kinda smelly.