diff --git a/server/gameserver/ingamevoice.cc b/server/gameserver/ingamevoice.cc index 3ef995e7..556e4d1c 100644 --- a/server/gameserver/ingamevoice.cc +++ b/server/gameserver/ingamevoice.cc @@ -46,27 +46,6 @@ void InGameVoice::OnHumanBeKill(int killer_id, Human* deader) InGameVoiceEventType_e::kGlobalKills, [this] (const mt::InGameVoice* meta) -> bool { - switch (meta->CondType()) { - case InGameVoiceCondType_e::kEQ: - { - - } - break; - case InGameVoiceCondType_e::kGT: - { - - } - break; - case InGameVoiceCondType_e::kGE: - { - - } - break; - default: - { - } - break; - } return true; }); } diff --git a/server/gameserver/mt/InGameVoice.cc b/server/gameserver/mt/InGameVoice.cc index 321096a5..b5c09998 100644 --- a/server/gameserver/mt/InGameVoice.cc +++ b/server/gameserver/mt/InGameVoice.cc @@ -129,14 +129,31 @@ namespace mt } } - InGameVoiceCondType_e InGameVoice::CondType() const + bool InGameVoice::MatchCond(int val) const { - return _cond_type; - } - - int InGameVoice::CondVal() const - { - return _cond_val; + switch (_cond_type) { + case InGameVoiceCondType_e::kEQ: + { + return _cond_val == val; + } + break; + case InGameVoiceCondType_e::kGT: + { + return _cond_val > val; + } + break; + case InGameVoiceCondType_e::kGE: + { + return _cond_val >= val; + } + break; + default: + { + return false; + } + break; + } + return false; } } diff --git a/server/gameserver/mt/InGameVoice.h b/server/gameserver/mt/InGameVoice.h index 1eb4d784..6ad67d6c 100644 --- a/server/gameserver/mt/InGameVoice.h +++ b/server/gameserver/mt/InGameVoice.h @@ -50,8 +50,7 @@ namespace mt void Init1(); void Init2(); InGameVoiceNotifyObject_e GetNotifyObject() const; - InGameVoiceCondType_e CondType() const; - int CondVal() const; + bool MatchCond(int val) const; static void Traverse(bool is_moba_room, int event_type, std::function cb);