This commit is contained in:
aozhiwei 2023-04-28 16:12:13 +08:00
parent 99970f916a
commit 801e833591

View File

@ -2581,6 +2581,7 @@ void Human::ProcLootWeapon(AddItemDTO& dto)
if (FreezeOperate()) { if (FreezeOperate()) {
return; return;
} }
bool droped = false;
if (weapons[GUN_SLOT1].weapon_id != 0 && weapons[GUN_SLOT2].weapon_id != 0) { if (weapons[GUN_SLOT1].weapon_id != 0 && weapons[GUN_SLOT2].weapon_id != 0) {
if (GetCurrWeapon() == &weapons[GUN_SLOT1]) { if (GetCurrWeapon() == &weapons[GUN_SLOT1]) {
if (mt::Param::s().pickup_weapon_replace_type) { if (mt::Param::s().pickup_weapon_replace_type) {
@ -2595,6 +2596,7 @@ void Human::ProcLootWeapon(AddItemDTO& dto)
DropWeapon(GUN_SLOT2, 1); DropWeapon(GUN_SLOT2, 1);
} }
} }
droped = true;
} }
bool switch_gun = false; bool switch_gun = false;
Weapon* weapon = TakeonWeapon(dto.item_meta); Weapon* weapon = TakeonWeapon(dto.item_meta);
@ -2606,6 +2608,9 @@ void Human::ProcLootWeapon(AddItemDTO& dto)
if (!weapon) { if (!weapon) {
return; return;
} }
if (droped && !mt::Param::s().pickup_weapon_replace_type) {
switch_gun = true;
}
weapon->weapon_id = dto.item_id; weapon->weapon_id = dto.item_id;
weapon->meta = dto.item_meta; weapon->meta = dto.item_meta;
weapon->ammo = 0; weapon->ammo = 0;