Fixes issues with raider equipping

Fixes raiders not being able to ever spawn with guns that cannot be equipped to the belt, despite those gun types being in the raider_guns list.
Fixes raiders spawning with guns for which they have no ammo.
Fixes taj/unathi raiders having a 2/3 chance of spawning without any shoes.
This commit is contained in:
mwerezak
2015-07-04 13:48:44 -04:00
parent fad0a712d8
commit c1bbc5c3a6
3 changed files with 95 additions and 14 deletions

View File

@@ -174,16 +174,8 @@
if(M.equip_to_appropriate_slot(newitem))
return newitem
if(istype(M.back,/obj/item/weapon/storage))
var/obj/item/weapon/storage/backpack = M.back
if(backpack.contents.len < backpack.storage_slots)
newitem.loc = M.back
return newitem
if(M.equip_to_storage(newitem))
return newitem
// Try to place it in any item that can store stuff, on the mob.
for(var/obj/item/weapon/storage/S in M.contents)
if (S.contents.len < S.storage_slots)
newitem.loc = S
return newitem
newitem.loc = get_turf(M.loc)
return newitem

View File

@@ -73,6 +73,21 @@ var/list/slot_equipment_priority = list( \
return 0
/mob/proc/equip_to_storage(obj/item/newitem)
// Try put it in their backpack
if(istype(src.back,/obj/item/weapon/storage))
var/obj/item/weapon/storage/backpack = src.back
if(backpack.contents.len < backpack.storage_slots)
newitem.loc = src.back
return 1
// Try to place it in any item that can store stuff, on the mob.
for(var/obj/item/weapon/storage/S in src.contents)
if (S.contents.len < S.storage_slots)
newitem.loc = S
return 1
return 0
//These procs handle putting s tuff in your hand. It's probably best to use these rather than setting l_hand = ...etc
//as they handle all relevant stuff like adding it to the player's screen and updating their overlays.