mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user