diff --git a/server/gameserver/human.h b/server/gameserver/human.h index d584eff..1f59b62 100644 --- a/server/gameserver/human.h +++ b/server/gameserver/human.h @@ -47,6 +47,7 @@ class Human : public Entity bool poisoning = false; long long poisoning_time = 0; long long dead_frameno = 0; + long long join_frameno = 0; Weapon default_weapon; std::vector weapons; diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 615003a..c2125b1 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -48,8 +48,16 @@ void Room::Update(int delta_time) UpdateGas(); } for (auto& pair : moveable_hash_) { - pair.second->Update(50); - pair.second->updated_times++; + if (pair.second->entity_type == ET_Player && + pair.second->updated_times <= 0) { + if (frame_no % 2 == 0) { + pair.second->Update(50); + pair.second->updated_times++; + } + } else { + pair.second->Update(50); + pair.second->updated_times++; + } } if (frame_no % 2 == 0) { ClearDeletedObjects(); @@ -139,6 +147,7 @@ void Room::AddPlayer(Player* hum) } hum->entity_uniid = AllocUniid(); hum->room = this; + hum->join_frameno = frame_no; hum->Initialize(); uniid_hash_[hum->entity_uniid] = hum; moveable_hash_[hum->entity_uniid] = hum; @@ -713,7 +722,7 @@ bool Room::GenSmallCircle(Vector2D big_circle_pos, float big_circle_rad, float s return true; } - void Room::OutputDebugLog() - { +void Room::OutputDebugLog() +{ - } +}