Clean up of RangeAttack a bit more
This commit is contained in:
parent
8aae88ca4f
commit
f4eb56e978
@ -384,13 +384,14 @@ bool Entity::RangeAttack(Spawn* victim, float distance, Item* weapon, Item* ammo
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(ammo->details.inv_slot_id >= 6) {
|
if(ammo->details.inv_slot_id >= 6) {
|
||||||
((Player*)this)->equipment_list.RemoveItem(ammo->details.slot_id, false);
|
((Player*)this)->equipment_list.RemoveItem(ammo->details.slot_id);
|
||||||
((Player*)this)->item_list.DestroyItem(ammo->details.index);
|
((Player*)this)->item_list.DestroyItem(ammo->details.index);
|
||||||
ammo = nullptr; // item is gone
|
ammo = nullptr; // item is gone
|
||||||
item_deleted = true;
|
item_deleted = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
((Player*)this)->equipment_list.RemoveItem(ammo->details.slot_id, true);
|
((Player*)this)->equipment_list.RemoveItem(ammo->details.slot_id, true);
|
||||||
|
ammo = nullptr;
|
||||||
item_deleted = true;
|
item_deleted = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user