merge master

This commit is contained in:
aozhiwei 2019-06-18 19:59:45 +08:00
commit 160ccf1580
2 changed files with 3 additions and 1 deletions

View File

@ -720,7 +720,7 @@ void Player::ProcPrepareItems(const ::google::protobuf::RepeatedField< ::google:
curr_weapon = &weapons[GUN_SLOT2];
}
}
if (!weapon) {
if (weapon) {
weapon->weapon_id = equip_id;
weapon->weapon_lv = std::max(1, GetWeaponConfigLv(weapon->weapon_id));
weapon->ammo = 0;

View File

@ -87,6 +87,7 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
Player* hum = PlayerMgr::Instance()->CreatePlayerByCMJoin(hdr.ip_saddr, hdr.socket_handle, msg);
hum->meta = hum_meta;
room->AddPlayer(hum);
hum->ProcPrepareItems(msg.prepare_items());
cs::SMJoinedNotify notifymsg;
notifymsg.set_error_code(0);
@ -118,6 +119,7 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
Player* hum = PlayerMgr::Instance()->CreatePlayerByCMJoin(hdr.ip_saddr, hdr.socket_handle, msg);
hum->meta = hum_meta;
room->AddPlayer(hum);
hum->ProcPrepareItems(msg.prepare_items());
{
cs::SMJoinedNotify notifymsg;