more
This commit is contained in:
parent
5017ff168a
commit
98c4d63756
1 changed files with 155 additions and 223 deletions
|
|
@ -92,11 +92,7 @@ export class Player extends PlayerBase {
|
|||
return;
|
||||
}
|
||||
this.observeClientTime(c.clientTimeMs);
|
||||
this.character?.shootTowards(
|
||||
position,
|
||||
finiteInRange(c.charge, 0, 1, 0),
|
||||
this.catchUpSeconds,
|
||||
);
|
||||
this.character?.shootTowards(position, finiteInRange(c.charge, 0, 1, 0));
|
||||
},
|
||||
[LeapActionCommand.type]: (c: LeapActionCommand) => {
|
||||
if (!isFiniteNumber(c.clientTimeMs)) {
|
||||
|
|
@ -125,12 +121,6 @@ export class Player extends PlayerBase {
|
|||
}
|
||||
}
|
||||
|
||||
// Derived from the measured RTT, NOT the client's timestamp, so a forged
|
||||
// stamp cannot buy extra lag compensation. fastForward caps the result.
|
||||
private get catchUpSeconds(): number {
|
||||
return Math.max(0, this.rttMs / 2 / 1000);
|
||||
}
|
||||
|
||||
constructor(
|
||||
playerInfo: PlayerInformation,
|
||||
playerContainer: PlayerContainer,
|
||||
|
|
|
|||
Loading…
Reference in a new issue