From 1163463151c9965fff5bd61b67326bb5758bf299 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 23 May 2019 09:47:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=87=AA=E6=9D=80=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/gameserver/human.cc | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 9a31937..393b32a 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -508,17 +508,25 @@ void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id) if (!dead && !room->game_over) { Entity* hum = room->GetEntityByUniId(killer_id); if (hum && hum->entity_type == ET_Player) { - ((Human*)hum)->stats.kills++; - ((Human*)hum)->kill_humans.insert(this); - MetaData::Equip* equip_meta = MetaMgr::Instance()->GetEquip(weapon_id); - if (equip_meta) { - std::string msg = a8::Format("%s 使用 %s 干掉了 %s", + if (killer_id == entity_uniid) { + std::string msg = a8::Format("%s 自杀", { killer_name, - equip_meta->i->name(), - name }); SendRollMsg(msg); + } else { + ((Human*)hum)->stats.kills++; + ((Human*)hum)->kill_humans.insert(this); + MetaData::Equip* equip_meta = MetaMgr::Instance()->GetEquip(weapon_id); + if (equip_meta) { + std::string msg = a8::Format("%s 使用 %s 干掉了 %s", + { + killer_name, + equip_meta->i->name(), + name + }); + SendRollMsg(msg); + } } } else { switch (weapon_id) {