This commit is contained in:
MarcEricMartel
2023-12-05 14:25:21 -05:00
parent 464ba131c4
commit b11a484a5a
6 changed files with 49 additions and 22 deletions

View File

@@ -136,6 +136,10 @@ Timestamp Connection::Run(World* world) {
in.keys.left,
in.keys.right,
in.keys.jump, false, el), world, el);
out.states.jumping = in.keys.jump;
out.states.running = player->GetVelocity().Length() > .3f;
out.states.dead = player->AmIDead();
if (in.keys.block) {
bool block = false;
@@ -147,14 +151,15 @@ Timestamp Connection::Run(World* world) {
ChunkDiffs.emplace_back(cmod);
}
if (in.keys.shoot && m_shoot_acc <= 0.)
if (in.keys.shoot && m_shoot_acc <= 0.) {
Bullets.push_back(Bullet(player->GetPOV() + player->GetDirection(), player->GetDirection()));
out.states.shooting = true;
}
out.position = player->GetPositionAbs();
out.direction = in.direction;
out.timestamp = in.timestamp;
out.id = m_playinfo.id;
m_output_manifest[out.timestamp] = out;
m_output_vector.push_back(out);
tstamp = out.timestamp;