1
This commit is contained in:
parent
b4b4af5985
commit
8196130498
@ -432,7 +432,7 @@ void Human::DecHP(float dec_hp, int killer_id, const std::string killer_name, in
|
||||
}
|
||||
}
|
||||
GetTrigger()->HpChg();
|
||||
room->OnHumanHpChg(this);
|
||||
room->OnTeamPartChg(this);
|
||||
}
|
||||
|
||||
void Human::AddToNewObjects(Entity* entity)
|
||||
|
@ -2639,9 +2639,21 @@ void Room::SendSMTeamFull(Human* hum)
|
||||
|
||||
}
|
||||
|
||||
void Room::OnHumanHpChg(Human* hum)
|
||||
void Room::OnTeamPartChg(Human* hum)
|
||||
{
|
||||
|
||||
if (hpchg_human_hash_.empty()) {
|
||||
hpchg_human_hash_[hum->GetUniId()] = hum;
|
||||
xtimer.SetTimeoutWpEx
|
||||
(SERVER_FRAME_RATE * 0.5,
|
||||
[this] (int event, const a8::Args* args)
|
||||
{
|
||||
if (a8::TIMER_EXEC_EVENT == event) {
|
||||
hpchg_human_hash_.clear();
|
||||
}
|
||||
},
|
||||
&xtimer_attacher_);
|
||||
hpchg_human_hash_[hum->GetUniId()] = hum;
|
||||
}
|
||||
}
|
||||
|
||||
int Room::InitWithCustomBattle(long ip_saddr, int socket_handle, std::shared_ptr<cs::CMJoin> msg,
|
||||
|
@ -286,7 +286,7 @@ public:
|
||||
int GetFullLevelIdx() { return ++curr_full_level_idx_;}
|
||||
std::shared_ptr<RoomOb> GetRoomOb();
|
||||
void SendSMTeamFull(Human* hum);
|
||||
void OnHumanHpChg(Human* hum);
|
||||
void OnTeamPartChg(Human* hum);
|
||||
|
||||
private:
|
||||
void ShuaAndroid();
|
||||
|
Loading…
x
Reference in New Issue
Block a user