This commit is contained in:
aozhiwei 2020-05-22 22:38:29 +08:00
parent d58a670d5e
commit 5aaee97d08
2 changed files with 4 additions and 2 deletions

View File

@ -89,7 +89,7 @@ void Room::Update(int delta_time)
return;
}
real_alive_count_ = 0;
real_alive_count_stat_ = 0;
elapsed_time_ += delta_time;
while (elapsed_time_ >= 50) {
if (frame_no % 2 == 0) {
@ -104,6 +104,7 @@ void Room::Update(int delta_time)
++frame_no;
elapsed_time_ -= 50;
}
real_alive_count_ = real_alive_count_stat_;
}
int Room::GetPlayerNum()

View File

@ -74,7 +74,7 @@ public:
int GetPlayerNum();
int AliveCount();
inline int RealAliveCount() { return real_alive_count_; }
inline void IncRealAliveCount() { ++real_alive_count_; }
inline void IncRealAliveCount() { ++real_alive_count_stat_; }
int ActiveCount();
Player* GetPlayerByAccountId(const std::string& accountid);
Player* GetPlayerByUniId(int uniid);
@ -171,6 +171,7 @@ private:
int elapsed_time_ = 0;
int alive_count_ = 0;
int real_alive_count_ = 0;
int real_alive_count_stat_ = 0;
int active_count_ = 0;
int force_shua_android_times_ = 0;
MetaData::AirLine* airline_ = nullptr;