how to fix the endgame sliding player bug?

Discussions about Coding and Scripting
Post Reply
OwYeaW
Experienced
Posts: 81
Joined: Fri Jan 09, 2015 4:24 pm

how to fix the endgame sliding player bug?

Post by OwYeaW »

yo guys, i would like to know how to fix this "sliding player bug"

this "sliding player bug" appears when the game has ended, every player that is not controlled by you, will slide horizontally until they get stuck in walls etc
now, ive seen this happening in many gametypes, so i guess this is a bug in the original UT code?

i would like to have all players frozen in their positions when the game has ended
any ideas on how to fix this bug?
Terraniux
Masterful
Posts: 717
Joined: Mon Jan 05, 2009 8:08 pm
Personal rank: Banished member

Re: how to fix the endgame sliding player bug?

Post by Terraniux »

Good topic. I find it also highly annoying. Although it brings sometimes funny moments, falling in lava or water. :lol2:
This member can only post when permitted.
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: how to fix the endgame sliding player bug?

Post by Barbie »

In most cases this avoids that Game-End-Gliding-Player in my server:

Code: Select all

function bool SetEndCams(string Reason) {
...
	for (P = Level.PawnList; P != None; P = P.nextPawn)
	{
		// remove velocity and freeze player:
		P.Velocity = vect(0,0,0);
		P.Acceleration = vect(0,0,0);
		P.SetPhysics(PHYS_None);
		P.SetLocation(P.Location);

		if (P.bIsPlayer && ((BestPawn == None) || (P.PlayerReplicationInfo.Score > BestPawn.PlayerReplicationInfo.Score)))
			BestPawn = P;
	}
...
In theory the code "P.SetLocation(P.Location)" should have no effect; I did not test that.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
OwYeaW
Experienced
Posts: 81
Joined: Fri Jan 09, 2015 4:24 pm

Re: how to fix the endgame sliding player bug?

Post by OwYeaW »

Barbie wrote:

Code: Select all

function bool SetEndCams(string Reason) {
...
	for (P = Level.PawnList; P != None; P = P.nextPawn)
	{
		// remove velocity and freeze player:
		P.Velocity = vect(0,0,0);
		P.Acceleration = vect(0,0,0);
		P.SetPhysics(PHYS_None);
		P.SetLocation(P.Location);

		if (P.bIsPlayer && ((BestPawn == None) || (P.PlayerReplicationInfo.Score > BestPawn.PlayerReplicationInfo.Score)))
			BestPawn = P;
	}
...
thank you for your correct answer, this works as desired :tu:
Higor
Godlike
Posts: 1866
Joined: Sun Mar 04, 2012 6:47 pm

Re: how to fix the endgame sliding player bug?

Post by Higor »

Gonna include this in XC_Engine's script patcher... if I remember to.
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: how to fix the endgame sliding player bug?

Post by sektor2111 »

And not only with bIsPlayer crap...
Post Reply