It's not immediately clear what causes it, but the function will sometimes fail to damage objects within its radius depending on their position around the actor. In the GIF below, the balloon remotely pops and calls P_RadiusAttack with a radius of 128 FU.
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
While this is probably at least partially a P_AproxDistance issue the meat of the problem seems to be that the blockmap check just fails to detect enemies sometimes:
While working on a branch exposing P_PathTraverse to Lua, I came across a bug similar to this where the traversal just would not detect any objects at certain positions. Eventually, I figured out the cause for both issues:
booleanP_BlockThingsIterator(INT32x,INT32y,boolean(*func)(mobj_t*)){mobj_t*mobj;blocknode_t*block;if(x<0||y<0||x>=bmapwidth||y>=bmapheight)returntrue;// Check interaction with the objects in the blockmap.for(block=blocklinks[y*bmapwidth+x];block;block=block->mnext){mobj=block->mobj;if(!func(mobj))returnfalse;if(P_MobjWasRemoved(tmthing))// func just broke blockmap chain, cannot continue.returntrue;}returntrue;}
If the line calling the function P_MobjWasRemoved and the line below it are removed or commented out, it fixes both problems. I'm not sure if removing these lines will result in anything breaking, and all I know is that they may have been added to make PIT_CheckThing run better (at least, according to Monster Iestyn).
If any other developer can shed some light on why these lines were added, that would be extremely helpful.