A_RadiusGive Overhaul

Moderator: GZDoom Developers

Post Reply
User avatar
Major Cooke
Posts: 8206
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

A_RadiusGive Overhaul

Post by Major Cooke »

Pull Request.

Fixed a lot of things wrong with A_RadiusGive, and added some goodies. See the pull request for more info.

If you're wondering, KILLED != CORPSE at all times. If you want true results of who is truly dead and whose not, use RGF_KILLED.

One thing I forgot to mention in the request is RGF_GIVESELF, the pointer flags and the species processing comes first. RGF_GIVESELF will always succeed now.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_RadiusGive Overhaul

Post by Graf Zahl »

One note:

MF_SPECIAL is NOT the same as being an inventory item. Strife's Spectres also use this flag.
User avatar
Major Cooke
Posts: 8206
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: A_RadiusGive Overhaul

Post by Major Cooke »

Fixing now.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: A_RadiusGive Overhaul

Post by NeuralStunner »

Seems like you'd have to check the inheritance chain.
User avatar
Major Cooke
Posts: 8206
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: A_RadiusGive Overhaul

Post by Major Cooke »

Only reason to do that is for state jumps, I think.

Graf: Fixed. No longer uses MF_SPECIAL, now uses thing->IsKindOf(RUNTIME_CLASS(AInventory)) instead.
User avatar
Beed28
Posts: 598
Joined: Sun Feb 24, 2013 4:07 pm
Location: United Kingdom

Re: A_RadiusGive Overhaul

Post by Beed28 »

Amazing! You truly are the best!

Can map-wide radiuses work reliably now, as well?
User avatar
Major Cooke
Posts: 8206
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: A_RadiusGive Overhaul

Post by Major Cooke »

They were working fine for me to begin with.

And, I'm not the best. Once they pointed out that it was flawed logic, the problem was much easier to fix than thought. :P
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_RadiusGive Overhaul

Post by Graf Zahl »

Merged, although I'll freely admit that I only superficially reviewed the code - it can only get better from what was there... :twisted:
User avatar
Major Cooke
Posts: 8206
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: A_RadiusGive Overhaul

Post by Major Cooke »

You can always tell me how I can improve upon it and I'll do my best to do so.

I had the uneasy feeling that a bunch of booleans would be frowned upon, but I didn't want to make as much of a mess.
User avatar
Xtyfe
Posts: 1490
Joined: Fri Dec 14, 2007 6:29 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support

Re: A_RadiusGive Overhaul

Post by Xtyfe »

Oh wow, this is very useful for me. Thanks for fixing it up :)
User avatar
Major Cooke
Posts: 8206
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: A_RadiusGive Overhaul

Post by Major Cooke »

Not a problem! I've updated the wiki too.

It should be noted I didn't touch the radius code. I'm going nowhere near it as I'm rather horrible at that kind of thing.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: A_RadiusGive Overhaul

Post by NeuralStunner »

Major Cooke wrote:thing->IsKindOf(RUNTIME_CLASS(AInventory))
Oh right, I forgot you could do this. Nevermind me. :P
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”