This commit is contained in:
MarcEricMartel
2023-12-06 15:47:14 -05:00
parent 7077b617be
commit db854c77b2
3 changed files with 8 additions and 1 deletions

View File

@@ -144,8 +144,11 @@ Timestamp Connection::Run(World* world) {
player->Killer = GetHash(true);
}
out.states.jumping = in.keys.jump;
out.states.jumping = player->GetVelocity().y > 0.1f;
out.states.running = player->GetVelocity().Length() > .3f;
out.states.still = !out.states.running;
out.states.hit = player->m_hit;
player->m_hit = false;
if (player->AmIDead()) {
in.keys.shoot = false;
@@ -171,6 +174,8 @@ Timestamp Connection::Run(World* world) {
if (in.keys.shoot && m_shoot_acc <= 0.) {
Bullets.emplace_back(new Bullet(player->GetPOV() + player->GetDirection(), player->GetDirection(), GetHash(true)));
out.states.shooting = true;
if (out.states.jumping)
out.states.jumpshot = true;
m_shoot_acc = BULLET_TIME;
}