diff --git a/SQCSim2021/engine.cpp b/SQCSim2021/engine.cpp index 4de61f3..18e0672 100644 --- a/SQCSim2021/engine.cpp +++ b/SQCSim2021/engine.cpp @@ -1520,13 +1520,17 @@ void Engine::Render(float elapsedTime) { char* prevptr = nullptr; Chat chat; for (auto& pck : lsPck) { // We could make a few threads out of this. - Sync sync; Output out; ChunkMod cmod; BulletAdd bull; + Sync sync; Output out; ChunkMod cmod; BulletAdd bull; PickupMod pmod; if (!prevptr) prevptr = m_buf.ptr; uint32_t bsize = m_buf.len - (pck - prevptr); prevptr = pck; switch (getType(pck, 1)) { using enum PACKET_TYPE; + case PICKUPMOD: + if (Deserialize(&pmod, pck, &bsize)) { + // TODO pikoppe + } case SYNC: if (Deserialize(&sync, pck, &bsize)) { if (sync.sid != m_conn.getId()) { @@ -1547,6 +1551,11 @@ void Engine::Render(float elapsedTime) { if (diff.y < 1.) diff.y = 0; + Boosts boost = sync.boost; + + m_player.boostdamage = boost.damage; + m_player.boostinvincible = boost.invincible; + if (diff.Length() > 1.5) { diff.Normalize(); m_player.Move(-diff); diff --git a/SQCSim2021/engine.h b/SQCSim2021/engine.h index cd3ee36..257af00 100644 --- a/SQCSim2021/engine.h +++ b/SQCSim2021/engine.h @@ -252,6 +252,7 @@ private: std::set m_deadplayers; netprot::Buffer m_buf, m_bufout; netprot::ChunkMod* m_chunkmod = nullptr; + std::map m_boosters; std::unordered_map m_syncs; std::string m_messageNotification = "";