1
This commit is contained in:
parent
7557bebd68
commit
8af871ed18
@ -687,9 +687,11 @@ void Player::LootInteraction(Loot* entity)
|
||||
add_num = std::min(entity->count, add_num);
|
||||
|
||||
AddInventory(item_meta->i->_inventory_slot(), add_num);
|
||||
if (item_meta->i->_inventory_slot() == 5 ||
|
||||
item_meta->i->_inventory_slot() == 6) {
|
||||
Weapon* weapon = &weapons[3 + (item_meta->i->_inventory_slot() - 5)];
|
||||
switch (item_meta->i->_inventory_slot()) {
|
||||
case IS_FRAG:
|
||||
case IS_SMOKE:
|
||||
{
|
||||
Weapon* weapon = &weapons[3 + (item_meta->i->_inventory_slot() - IS_FRAG)];
|
||||
weapon->weapon_id = entity->item_id;
|
||||
weapon->weapon_lv = 1;
|
||||
weapon->ammo += entity->count;
|
||||
@ -697,11 +699,38 @@ void Player::LootInteraction(Loot* entity)
|
||||
weapon->Recalc();
|
||||
DecInventory(item_meta->i->_inventory_slot(), add_num);
|
||||
}
|
||||
if (item_meta->i->_inventory_slot() > 12) {
|
||||
if (item_meta->i->_inventory_slot() - 12 > curr_scope_idx) {
|
||||
curr_scope_idx = item_meta->i->_inventory_slot() - 12;
|
||||
break;
|
||||
case IS_1XSCOPE:
|
||||
case IS_2XSCOPE:
|
||||
case IS_4XSCOPE:
|
||||
case IS_8XSCOPE:
|
||||
case IS_15XSCOPE:
|
||||
{
|
||||
if (item_meta->i->_inventory_slot() - IS_1XSCOPE > curr_scope_idx) {
|
||||
curr_scope_idx = item_meta->i->_inventory_slot() - IS_1XSCOPE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case IS_POSION_GAS_BOMB:
|
||||
case IS_MOLOTOR_COCKTAIL:
|
||||
case IS_TRAP:
|
||||
case IS_MINE:
|
||||
{
|
||||
Weapon* weapon = &weapons[5 + (item_meta->i->_inventory_slot() - IS_POSION_GAS_BOMB)];
|
||||
weapon->weapon_id = entity->item_id;
|
||||
weapon->weapon_lv = 1;
|
||||
weapon->ammo += entity->count;
|
||||
weapon->meta = item_meta;
|
||||
weapon->Recalc();
|
||||
DecInventory(item_meta->i->_inventory_slot(), add_num);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
abort();
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (add_num < entity->count) {
|
||||
//刷新数量
|
||||
entity->count -= add_num;
|
||||
|
Loading…
x
Reference in New Issue
Block a user