omg 💣
This commit is contained in:
@@ -122,6 +122,13 @@ void Connection::Run(World* world) {
|
||||
last = m_input_vector.at(m_last_in);
|
||||
|
||||
el = (double)(in.timestamp - last.timestamp) / 1000.;
|
||||
|
||||
if (m_shoot_acc > 0.) {
|
||||
m_shoot_acc -= el;
|
||||
if (m_shoot_acc < 0.)
|
||||
m_shoot_acc = 0;
|
||||
}
|
||||
|
||||
player.get()->SetDirection(in.direction);
|
||||
player.get()->ApplyPhysics(player.get()->GetInput(in.keys.forward,
|
||||
in.keys.backward,
|
||||
@@ -129,6 +136,13 @@ void Connection::Run(World* world) {
|
||||
in.keys.right,
|
||||
in.keys.jump, false, el), world, el);
|
||||
|
||||
//if (in.keys.block)
|
||||
// ChunkDiffs.push_back()
|
||||
|
||||
if (in.keys.shoot && m_shoot_acc <= 0.)
|
||||
Bullets.push_back(Bullet(player.get()->GetPOV() + player.get()->GetDirection(), player.get()->GetDirection()));
|
||||
|
||||
|
||||
out.position = player.get()->GetPositionAbs();
|
||||
out.direction = in.direction;
|
||||
out.timestamp = in.timestamp;
|
||||
|
@@ -42,8 +42,8 @@ public:
|
||||
|
||||
bool m_nsync = true;
|
||||
|
||||
std::vector<Bullet> m_bullet_vector;
|
||||
std::vector<ChunkMod> m_diff_vector;
|
||||
std::vector<Bullet> Bullets;
|
||||
std::vector<ChunkMod> ChunkDiffs;
|
||||
|
||||
private:
|
||||
std::unordered_map<Timestamp, Input> m_input_manifest;
|
||||
@@ -52,6 +52,7 @@ private:
|
||||
std::deque<Output> m_output_vector;
|
||||
std::unordered_map<Timestamp, Chat> m_chatlog;
|
||||
|
||||
float m_shoot_acc = 0;
|
||||
|
||||
SOCKET m_sock;
|
||||
sockaddr_in m_addr;
|
||||
|
Reference in New Issue
Block a user