Let's all die!

This commit is contained in:
MarcEricMartel
2023-12-13 16:10:23 -05:00
parent 37a86d42a3
commit 49374a7dea
3 changed files with 55 additions and 9 deletions

View File

@@ -93,16 +93,23 @@ void Connection::sendPacks(SOCKET sock, std::unordered_map<uint64_t, Connection*
outs += out.timestamp + last;
if (outs >= SYNC_ACC) {
outs -= SYNC_ACC;
static bool syncdead = false;
bool dead = player->AmIDead();
if (outs >= SYNC_ACC || (!syncdead && dead)) {
Sync sync;
sync.hp = player->GetHP();
outs -= SYNC_ACC;
sync.timestamp = out.timestamp;
sync.position = out.position;
sync.sid = m_loginfo.sid;
sync.timer = timer;
sync.timestamp = out.timestamp;
sync.ammo = -1;
sync.hp = player->GetHP();
if (dead) {
sync.timestamp = m_loginfo.sid;
syncdead = true;
}
sendPackTo<Sync>(sock, &sync, &m_bufout, &m_addr);
}
@@ -118,7 +125,7 @@ Timestamp Connection::Run(World* world) {
bool dead = player->AmIDead();
if (m_input_manifest.size() < 2)
if (m_input_manifest.size() < 2 && !dead)
return tstamp;
while (m_last_in < m_input_vector.size() - 1 || dead) {