diff --git a/server/gameserver/team.cc b/server/gameserver/team.cc index 769d933e..9586498a 100644 --- a/server/gameserver/team.cc +++ b/server/gameserver/team.cc @@ -499,3 +499,9 @@ int Team::GetKillCount() { return kill_count_; } + +void Team::IncKillCount() +{ + ++kill_count_; + last_kill_frameno_ = room->GetFrameNo(); +} diff --git a/server/gameserver/team.h b/server/gameserver/team.h index aacc2e42..8e03ceae 100644 --- a/server/gameserver/team.h +++ b/server/gameserver/team.h @@ -52,7 +52,9 @@ class Team void RunAway(Human* hum); bool AllIsRunAway(); bool IsViewTeam() { return is_view_; } + void IncKillCount(); int GetKillCount(); + long long GetLastKillFrameNo() { return last_kill_frameno_; } private: int team_id_ = 0; @@ -63,4 +65,5 @@ class Team Human* first_member_ = nullptr; bool auto_fill_ = false; int kill_count_ = 0; + long long last_kill_frameno_ = 0; }; diff --git a/server/gameserver/trigger.cc b/server/gameserver/trigger.cc index 70f2b48e..c7ded0a2 100644 --- a/server/gameserver/trigger.cc +++ b/server/gameserver/trigger.cc @@ -148,6 +148,7 @@ void Trigger::Kill(Creature* target, int weapon_id) owner_hum->CalcAssists(target_hum); if (target->GetUniId() != owner_->GetUniId()) { owner_->AsHuman()->stats->kills++; + owner_->AsHuman()->GetTeam()->IncKillCount(); } owner_->AsHuman()->stats->last_kill_frameno = owner_->room->GetFrameNo(); owner_->AsHuman()->kill_humans.insert(target->AsHuman());