X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fclient%2Fclient.cpp;h=d20a98c32bcdcd514d44fb7ef37c5964416f9fb0;hb=b9462143d9b2fd1f54aa3b4ec32eecb62c01615f;hp=0eec9847b0473e666197052dd6b3f668d40411ef;hpb=1a237f316ee603e2130dc46b9f7d75a169763543;p=blank.git diff --git a/src/client/client.cpp b/src/client/client.cpp index 0eec984..d20a98c 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -62,7 +62,9 @@ InteractiveState::InteractiveState(MasterState &master, uint32_t player_id) , stat_timer(1000) , sky(master.GetEnv().loader.LoadCubeMap("skybox")) , update_status() -, chat(master.GetEnv(), *this, *this) { +, chat(master.GetEnv(), *this, *this) +, time_skipped(0) +, packets_skipped(0) { if (!save.Exists()) { save.Write(master.GetWorldConf()); } @@ -163,7 +165,14 @@ void InteractiveState::Update(int dt) { hud.FocusNone(); } if (world_dt > 0) { - input.PushPlayerUpdate(world_dt); + if (input.UpdateImportant() || packets_skipped >= master.NetStat().SuggestedPacketSkip()) { + input.PushPlayerUpdate(time_skipped + world_dt); + time_skipped = 0; + packets_skipped = 0; + } else { + time_skipped += world_dt; + ++packets_skipped; + } } hud.Display(res.block_types[player.GetInventorySlot() + 1]); if (stat_timer.Hit()) {