mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-25 22:25:53 +02:00
Archive update v0.55.2
This commit is contained in:
@@ -139,7 +139,21 @@ export function boopAction(game: PonyTownGame) {
|
||||
}
|
||||
|
||||
export function turnHeadAction(game: PonyTownGame) {
|
||||
if (game.player && game.send(server => server.action(Action.TurnHead))) {
|
||||
if (!game.player) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (game.player.animator.state) {
|
||||
const disabledFrames = game.player.animator.state.animation.disableHeadTurnFrames;
|
||||
if (disabledFrames > 0) {
|
||||
const disabledTime = disabledFrames / game.player.animator.state.animation.fps;
|
||||
if (disabledTime >= game.player.animator.time) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (game.send(server => server.action(Action.TurnHead))) {
|
||||
game.player.state = game.player.state ^ EntityState.HeadTurned;
|
||||
game.headTurnedOverride = hasFlag(game.player.state, EntityState.HeadTurned);
|
||||
game.onActionsUpdate.next();
|
||||
|
||||
Reference in New Issue
Block a user