mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-07-16 08:55:18 +00:00
always display players in their proper locations when nearing their view, even if they have been stationary this whole time
This commit is contained in:
parent
1f14df0e0a
commit
069eab408f
1 changed files with 5 additions and 3 deletions
|
|
@ -83,12 +83,13 @@ class SessionAvatarHandlers(
|
|||
val currentDistance = Vector3.DistanceSquared(ourPosition, pos) //sq.m
|
||||
val inVisibleRange = currentDistance <= maxRange
|
||||
val wasInVisibleRange = Vector3.DistanceSquared(lastPosition, pos) <= maxRange
|
||||
val comingIntoVisibleRange = inVisibleRange && !wasInVisibleRange
|
||||
val now = System.currentTimeMillis() //ms
|
||||
val durationSince = now - lastTime //ms
|
||||
val released = player.isReleased
|
||||
if (!released &&
|
||||
((!spectating && inVisibleRange && !lastMsg.contains(pstateToSave)) ||
|
||||
(inVisibleRange && wasSpectating && !spectating))) { //this condition is unlikely, but ...
|
||||
!spectating &&
|
||||
(comingIntoVisibleRange || (inVisibleRange && !lastMsg.contains(pstateToSave)))) {
|
||||
lazy val targetDelay = {
|
||||
val populationOver = math.max(
|
||||
0,
|
||||
|
|
@ -101,7 +102,8 @@ class SessionAvatarHandlers(
|
|||
case index => drawConfig.delays(index)
|
||||
}
|
||||
} //ms
|
||||
if (canSeeReallyFar ||
|
||||
if (comingIntoVisibleRange ||
|
||||
canSeeReallyFar ||
|
||||
currentDistance < drawConfig.rangeMin * drawConfig.rangeMin ||
|
||||
durationSince > drawConfig.delayMax ||
|
||||
sessionData.canSeeReallyFar ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue