diff --git a/server/gameserver/player.cc b/server/gameserver/player.cc index ce5202d8..1953e5e9 100644 --- a/server/gameserver/player.cc +++ b/server/gameserver/player.cc @@ -1397,25 +1397,28 @@ void Player::_CMCancelRevive(f8::MsgHdr* hdr, const cs::CMCancelRevive& msg) void Player::_CMRequestBulletDmg(f8::MsgHdr* hdr, const cs::CMRequestBulletDmg& msg) { auto itr = room->report_bullet_hash.find(msg.bullet_uniid()); + if (itr == room->report_bullet_hash.end()) { #ifdef MYDEBUG - a8::XPrintf("CMRequestBulletDmg bullet_uniid:%d shield_hit:%d strengthen_wall_uniid:%d target_uniid:%d found:%d pos:%f,%f,%f\n", + a8::XPrintf("CMRequestBulletDmg bullet_uniid:%d shield_hit:%d strengthen_wall_uniid:%d target_uniid:%d found:%d pos:%f,%f,%f equip_id:%d\n", { msg.bullet_uniid(), msg.shield_hit(), msg.strengthen_wall_uniid(), msg.target_uniid(), - itr == room->report_bullet_hash.end() ? 0 :1, - msg.pos().x(), - msg.pos().y(), - msg.pos().z() + itr == room->report_bullet_hash.end() ? 0 :1, + msg.pos().x(), + msg.pos().y(), + msg.pos().z(), + 0 }); #endif - if (itr == room->report_bullet_hash.end()) { return; } + int equip_id = 0; Entity* bullet_entity = room->GetEntityByUniId(msg.bullet_uniid()); if (bullet_entity && bullet_entity->GetEntityType() == ET_Bullet) { + equip_id = ((Bullet*)bullet_entity)->gun_meta->id(); ((Bullet*)bullet_entity)->ProcRequestBulletDmg ( msg.shield_hit(), @@ -1424,6 +1427,20 @@ void Player::_CMRequestBulletDmg(f8::MsgHdr* hdr, const cs::CMRequestBulletDmg& glm::vec3(msg.pos().x(), msg.pos().y(), msg.pos().z()) ); } +#ifdef MYDEBUG + a8::XPrintf("CMRequestBulletDmg bullet_uniid:%d shield_hit:%d strengthen_wall_uniid:%d target_uniid:%d found:%d pos:%f,%f,%f equip_id:%d\n", + { + msg.bullet_uniid(), + msg.shield_hit(), + msg.strengthen_wall_uniid(), + msg.target_uniid(), + itr == room->report_bullet_hash.end() ? 0 :1, + msg.pos().x(), + msg.pos().y(), + msg.pos().z(), + equip_id + }); +#endif room->report_bullet_hash.erase(msg.bullet_uniid()); }