mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-27 23:25:41 +03:00
pm_shared.cpp: minor refactoring
This commit is contained in:
parent
8591bbd13d
commit
5e235a9851
@ -1480,12 +1480,9 @@ void PM_CategorizePosition()
|
|||||||
int PM_GetRandomStuckOffsets(int nIndex, int server, vec_t *offset)
|
int PM_GetRandomStuckOffsets(int nIndex, int server, vec_t *offset)
|
||||||
{
|
{
|
||||||
// Last time we did a full
|
// Last time we did a full
|
||||||
int idx;
|
int idx = rgStuckLast[nIndex][server]++;
|
||||||
idx = rgStuckLast[nIndex][server]++;
|
VectorCopy(rgv3tStuckTable[idx % ARRAYSIZE(rgv3tStuckTable)], offset);
|
||||||
|
return (idx % ARRAYSIZE(rgv3tStuckTable));
|
||||||
VectorCopy(rgv3tStuckTable[idx % 54], offset);
|
|
||||||
|
|
||||||
return (idx % 54);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PM_ResetStuckOffsets(int nIndex, int server)
|
void PM_ResetStuckOffsets(int nIndex, int server)
|
||||||
@ -1542,7 +1539,7 @@ qboolean PM_CheckStuck()
|
|||||||
|
|
||||||
nReps++;
|
nReps++;
|
||||||
}
|
}
|
||||||
while (nReps < 54);
|
while (nReps < ARRAYSIZE(rgv3tStuckTable));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1571,7 +1568,7 @@ qboolean PM_CheckStuck()
|
|||||||
{
|
{
|
||||||
PM_ResetStuckOffsets(pmove->player_index, pmove->server);
|
PM_ResetStuckOffsets(pmove->player_index, pmove->server);
|
||||||
|
|
||||||
if (i >= 27)
|
if (i >= (ARRAYSIZE(rgv3tStuckTable) / 2))
|
||||||
{
|
{
|
||||||
VectorCopy(test, pmove->origin);
|
VectorCopy(test, pmove->origin);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user