SYNC_ACC CMOD_ACC GLOBALS
This commit is contained in:
@@ -242,9 +242,9 @@ void Server::Run() {
|
||||
if (last == 0)
|
||||
last = tstamp;
|
||||
sync_acc += tstamp - last;
|
||||
if (sync_acc >= 1000) {
|
||||
while (sync_acc >= 1000)
|
||||
sync_acc -= 1000;
|
||||
if (sync_acc >= SYNC_ACC) {
|
||||
while (sync_acc >= SYNC_ACC)
|
||||
sync_acc -= SYNC_ACC;
|
||||
--timer;
|
||||
std::string str = "Timer: ";
|
||||
Log(str.append(std::to_string(timer)), false, false);
|
||||
@@ -304,7 +304,6 @@ void Server::Run() {
|
||||
|
||||
for (auto& bull : conn->Bullets) {
|
||||
bullets.emplace_back(bull);
|
||||
//Log("POW!", false, false);
|
||||
BulletAdd* nbul = new BulletAdd();
|
||||
nbul->pos = bull->getPos();
|
||||
nbul->dir = bull->getVel();
|
||||
@@ -315,12 +314,11 @@ void Server::Run() {
|
||||
}
|
||||
conn->Bullets.clear();
|
||||
}
|
||||
|
||||
/* Out */
|
||||
|
||||
conn->sendPacks(m_sock_udp, m_conns, timer);
|
||||
}
|
||||
if ((deadplayers == players - 1 && deadplayers != 0) || timer <= 0)
|
||||
/* Out */
|
||||
conn->sendPacks(m_sock_udp, m_conns, timer);
|
||||
|
||||
if ((deadplayers == players - 1 && deadplayers != 0) || timer < 0)
|
||||
endgame = true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user