[Fixed] CheckProximity and picked up items

Bugs that have been investigated and resolved somehow.

Moderator: Developers

CheckProximity and picked up items

Postby jdagenet » Sun Jul 08, 2018 12:25 am

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 10 times
jdagenet
 
Joined: 09 Aug 2011

Re: CheckProximity and picked up items

Postby _mental_ » Sun Jul 08, 2018 7:09 am

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.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: CheckProximity and picked up items

Postby jdagenet » Sun Jul 08, 2018 11:33 am

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?
jdagenet
 
Joined: 09 Aug 2011

Re: CheckProximity and picked up items

Postby Matt » Mon Jul 09, 2018 1:11 am

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
Matt
Putting the XD into *xdeath since 2007
 
 
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: CheckProximity and picked up items

Postby Graf Zahl » Mon Jul 09, 2018 1:19 pm

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

Re: CheckProximity and picked up items

Postby _mental_ » Wed Jul 11, 2018 9:27 am

I think it should be fixed like this. Made a pull request just to be sure.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: CheckProximity and picked up items

Postby Graf Zahl » Wed Jul 11, 2018 10:50 am

That looks correct.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Bugs

Who is online

Users browsing this forum: Semrush [Bot] and 1 guest