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) {