CheckProximity and picked up items

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
jdagenet
Posts: 77
Joined: Tue Aug 09, 2011 10:26 pm

CheckProximity and picked up items

Post by jdagenet »

CheckProximity still detects some items such as weapons and ammo even after they're picked up. For weapons specifically, it appears that for any weapon that is present in the map once it loads is prone to this, but any that are summoned within the level appear to function as intended.
From what I've tested, items such as health, armor, and most ammo types appear to be unaffected by this though I was getting some strange results involving the Shotgun Shells ammo pickup.

I've attached a file to load up that performs a check for any nearby Shotguns in the map.
Attachments
checkprox_test.pk3
(992 Bytes) Downloaded 31 times
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: CheckProximity and picked up items

Post by _mental_ »

CheckProximity() iterates on thinkers, not only on remaining level items. For historical reasons position of actor isn't changed when weapon is picked up. That's why it is found by proximity test.
Of course it's not a big deal to set position after pickup to some very large (or very small) value outside of level bound. Unfortunately it's quite hard to predict what side effects it may or may not cause.
jdagenet
Posts: 77
Joined: Tue Aug 09, 2011 10:26 pm

Re: CheckProximity and picked up items

Post by jdagenet »

I see. Would there be any sort of work around currently that can mediate this problem? Something similar to CheckProximity or a custom ACS function perhaps?
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: CheckProximity and picked up items

Post by Matt »

Could there be an option to skip all actors that have an owner / don't have a physical body in the playsim?

(Or maybe not even make it an option - are there any mods that deliberately take advantage of this behaviour?)
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: CheckProximity and picked up items

Post by Graf Zahl »

A function that scans the map for items should never pick an owned item. Any theoretical mod depending on such a quirk has to be considered broken.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: CheckProximity and picked up items

Post by _mental_ »

I think it should be fixed like this. Made a pull request just to be sure.
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: CheckProximity and picked up items

Post by Graf Zahl »

That looks correct.
Post Reply

Return to “Closed Bugs [GZDoom]”