1
This commit is contained in:
parent
8a67dda32c
commit
c240b72f13
@ -51,6 +51,7 @@ void InGameVoice::UnInit()
|
||||
void InGameVoice::OnHumanBeKill(int killer_id, Human* deader)
|
||||
{
|
||||
personal_nodead_series_kills_.erase(deader->GetUniId());
|
||||
personal_nodead_timer_attacher_.erase(deader->GetUniId());
|
||||
if (killer_id == deader->GetUniId()) {
|
||||
return;
|
||||
}
|
||||
@ -88,7 +89,7 @@ void InGameVoice::OnHumanBeKill(int killer_id, Human* deader)
|
||||
}
|
||||
},
|
||||
&room_->xtimer_attacher_);
|
||||
#if 0
|
||||
if (!killer->dead) {
|
||||
room_->xtimer.SetTimeoutWpEx
|
||||
(
|
||||
SERVER_FRAME_RATE * mt::InGameVoice::s_series_kill_interval,
|
||||
@ -98,8 +99,8 @@ void InGameVoice::OnHumanBeKill(int killer_id, Human* deader)
|
||||
DecIntMap(room->GetInGameVoice()->personal_nodead_series_kills_, killer_id);
|
||||
}
|
||||
},
|
||||
&room_->xtimer_attacher_);
|
||||
#endif
|
||||
GetNoDeadTimerAttacher(killer_id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,3 +108,14 @@ void InGameVoice::Notify(Human* killer, Human* deader, const mt::InGameVoice* me
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
a8::Attacher* InGameVoice::GetNoDeadTimerAttacher(int killer_id)
|
||||
{
|
||||
auto itr = personal_nodead_timer_attacher_.find(killer_id);
|
||||
if (itr == personal_nodead_timer_attacher_.end()) {
|
||||
personal_nodead_timer_attacher_[killer_id] = a8::Attacher();
|
||||
itr = personal_nodead_timer_attacher_.find(killer_id);
|
||||
itr->second.SetOwner(&room_->xtimer);
|
||||
}
|
||||
return &itr->second;
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ class InGameVoice : public std::enable_shared_from_this<InGameVoice>
|
||||
|
||||
private:
|
||||
void UpdateTeamBeKillLastTime(int team_id);
|
||||
a8::Attacher* GetNoDeadTimerAttacher(int killer_id);
|
||||
|
||||
void Notify(Human* killer, Human* deader, const mt::InGameVoice* meta);
|
||||
|
||||
@ -27,5 +28,6 @@ private:
|
||||
std::map<int, int> personal_kills_;
|
||||
std::map<int, int> personal_series_kills_;
|
||||
std::map<int, int> personal_nodead_series_kills_;
|
||||
std::map<int, a8::Attacher> personal_nodead_timer_attacher_;
|
||||
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user