MCPcopy Create free account
hub / github.com/assaultcube/AC / updateplayerpos

Function updateplayerpos

source/src/clients2c.cpp:89–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87// just don't overlap with our client
88
89void updateplayerpos(playerent *d)
90{
91 const float r = player1->radius+d->radius;
92 const float dx = player1->o.x-d->o.x;
93 const float dy = player1->o.y-d->o.y;
94 const float dz = player1->o.z-d->o.z;
95 const float rz = player1->aboveeye+d->eyeheight;
96 const float fx = (float)fabs(dx), fy = (float)fabs(dy), fz = (float)fabs(dz);
97 if(fx<r && fy<r && fz<rz && d->state!=CS_DEAD)
98 {
99 if(fx<fy) d->o.y += dy<0 ? r-fy : -(r-fy); // push aside
100 else d->o.x += dx<0 ? r-fx : -(r-fx);
101 }
102}
103
104void updatelagtime(playerent *d)
105{

Callers 1

parsepositionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected