添加子弹掉落
This commit is contained in:
parent
07ee948c2a
commit
c941bd2c59
@ -2223,6 +2223,13 @@ void Human::DeadDrop()
|
||||
) {
|
||||
a8::Vec2 drop_pos = GetPos();
|
||||
room->DropItem(drop_pos, weapon.weapon_id, 1, weapon.weapon_lv);
|
||||
if (weapon.ammo > 0 && weapon.bullet_meta && weapon.ammo < 200) {
|
||||
if (IsPlayer() &&
|
||||
weapon.bullet_meta &&
|
||||
IsValidSlotId(weapon.bullet_meta->i->_inventory_slot())) {
|
||||
AddInventory(weapon.bullet_meta->i->_inventory_slot(), weapon.ammo);
|
||||
}
|
||||
}
|
||||
weapon.Clear();
|
||||
}
|
||||
}
|
||||
@ -2276,6 +2283,7 @@ void Human::DeadDrop()
|
||||
if (GetInventory(slot) > 0) {
|
||||
MetaData::Equip* equip_meta = MetaMgr::Instance()->GetEquipBySlotId(slot);
|
||||
if (equip_meta) {
|
||||
int drop_num = equip_meta->i->group_num();
|
||||
if (equip_meta->i->equip_type() == EQUIP_TYPE_BULLET) {
|
||||
switch (equip_meta->i->_inventory_slot()) {
|
||||
case IS_FRAG:
|
||||
@ -2284,18 +2292,41 @@ void Human::DeadDrop()
|
||||
case IS_MOLOTOR_COCKTAIL:
|
||||
case IS_TRAP:
|
||||
case IS_MINE:
|
||||
case IS_C4:
|
||||
case IS_SHIELD_WALL:
|
||||
case IS_SINGAL_GUN:
|
||||
case IS_OIL_BUCKET:
|
||||
{
|
||||
if (drop_num > 0) {
|
||||
a8::Vec2 drop_pos = GetPos();
|
||||
if (IsPlayer()) {
|
||||
room->DropItem(drop_pos, equip_meta->i->id(), GetInventory(slot), 1);
|
||||
} else {
|
||||
room->DropItem(drop_pos, equip_meta->i->id(), drop_num, 1);
|
||||
}
|
||||
DecInventory(slot, GetInventory(slot));
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
if (drop_num > 0) {
|
||||
a8::Vec2 drop_pos = GetPos();
|
||||
if (IsPlayer()) {
|
||||
room->DropItem(drop_pos, equip_meta->i->id(), GetInventory(slot), 1);
|
||||
} else {
|
||||
room->DropItem(drop_pos, equip_meta->i->id(), drop_num, 1);
|
||||
}
|
||||
DecInventory(slot, GetInventory(slot));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
#if 0
|
||||
a8::Vec2 drop_pos = GetPos();
|
||||
room->DropItem(drop_pos, equip_meta->i->id(), GetInventory(slot), 1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user