Fixed Player can turn off pushers in FOFs with pushable object if standing near the FOF

Status
Not open for further replies.

Ezer'Arch

ArchPack 2.5 is on the way
This bug is not critical (o well, see EDIT2). I was making some experiences in my maps, then I discovered this:

1) Build a hole and put an intangible FOF in the hole (the blue tint is for better visualization);

UpNli.png


2) Give the FOF an upward wind effect (linedef type 542 or 545);

3) Drop a pushable object into the hole, the object will float as intended;

zNCmm.png


4) Player stands up near the hole, the wind effect is turned off and the object gets stuck in the bottom;

Slu50.png


5) Player moves away, pushable object skyrockets ^^

VZ0Mf.png


Sample wad: http://dl.dropbox.com/u/4799936/SRB2/Files/UpwardWindBug.wad

EDIT:

Not only standing near, fly over as Tails, the bug persists.

NAXmD.png


EDIT2:

Tested with a player and 1 bot (it's likely to happen in netgame):

NWlsW.png
 
Last edited:
It doesn't really "skyrocket" though. Just about x1.5 the height it originally reaches to.
 
All right, I found the problem. =)

In the code below (found in src/p_spec.c)...
Code:
if (thing->eflags & MFE_VERTICALFLIP)
{
	if (referrer->floorheight > thing->z + thing->height
		|| referrer->ceilingheight < (thing->z + (thing->height >> 1)))
		return;

	if (thing->z < referrer->floorheight)
		touching = true;

	if (thing->z + (thing->height >> 1) > referrer->floorheight)
		inFOF = true;

}
else
{
	if (referrer->ceilingheight < thing->z || referrer->floorheight > (thing->z + (thing->height >> 1)))
		return;

	if (thing->z + thing->height > referrer->ceilingheight)
		touching = true;

	if (thing->z + (thing->height >> 1) < referrer->ceilingheight)
		inFOF = true;
}
... the two "return"s are the culprits.


NOTES:
  • This bug actually affects any kind of pusher, not just up-currents/winds.
  • This bug only affects pushers on FOFs and the following explanation of the problem takes that in consideration.

Since the aforementioned block of code is called inside a for loop, iterating over the things touching a pusher sector (touching the target sector), and because when a new thing enters a sector it gets added to the head of its touching list, the next time the thinker T_Pusher is called, if the new thing is above/below the FOF's ceiling/floor, the thinker aborts instead of testing further things.

So, the solution is simply to replace those "return"s with "continue"s.
 
Nice find, Ricardo. ;) I don't always have time during the school week to troubleshoot bugs. Committed the change.
 
Let me question a thing: does this bugfix fix this case too?

Stack two or more pushable objects and they aren't affected by pusher effect, even if the player is away from the FOF (MOB r6664:6668).

WP6zp.png


Just to make sure if we really got rid of this bug entirely.

EDIT:

In the old times, when I was used to host netgame serves, I had seen a similar bug: if two or more players are in the same waterslide FOF, one of players suddenly stands up for few tics and then goes back into S_PainState.
 
Last edited:
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top