Merge pull request #10996 from PsiOmegaDelta/150804-CrawlThroughThoseVents

Vent crawling now explicitly checks for equipped items.
This commit is contained in:
GinjaNinja32
2015-09-05 16:59:33 +01:00
2 changed files with 14 additions and 23 deletions

View File

@@ -221,18 +221,21 @@ var/list/slot_equipment_priority = list( \
if(!I) //If there's nothing to drop, the drop is automatically successful. if(!I) //If there's nothing to drop, the drop is automatically successful.
return 1 return 1
var/slot var/slot = get_inventory_slot(I)
for(var/s in slot_back to slot_tie) //kind of worries me
if(get_equipped_item(s) == I)
slot = s
break
if(slot && !I.mob_can_unequip(src, slot)) if(slot && !I.mob_can_unequip(src, slot))
return 0 return 0
drop_from_inventory(I) drop_from_inventory(I)
return 1 return 1
/mob/proc/get_inventory_slot(obj/item/I)
var/slot
for(var/s in slot_back to slot_tie) //kind of worries me
if(get_equipped_item(s) == I)
slot = s
break
return slot
//Attemps to remove an object on a mob. //Attemps to remove an object on a mob.
/mob/proc/remove_from_mob(var/obj/O) /mob/proc/remove_from_mob(var/obj/O)
src.u_equip(O) src.u_equip(O)

View File

@@ -656,27 +656,15 @@ default behaviour is:
set category = "IC" set category = "IC"
resting = !resting resting = !resting
src << "\blue You are now [resting ? "resting" : "getting up"]" src << "<span class='notice'>You are now [resting ? "resting" : "getting up"]</span>"
/mob/living/proc/is_allowed_vent_crawl_item(var/obj/item/carried_item) /mob/living/proc/is_allowed_vent_crawl_item(var/obj/item/carried_item)
if(istype(carried_item, /obj/item/weapon/implant)) return isnull(get_inventory_slot(carried_item))
return 1
if(istype(carried_item, /obj/item/clothing/mask/facehugger))
return 1
return 0
/mob/living/carbon/is_allowed_vent_crawl_item(var/obj/item/carried_item)
if(carried_item in internal_organs)
return 1
return ..()
/mob/living/carbon/human/is_allowed_vent_crawl_item(var/obj/item/carried_item)
if(carried_item in organs)
return 1
return ..()
/mob/living/simple_animal/spiderbot/is_allowed_vent_crawl_item(var/obj/item/carried_item) /mob/living/simple_animal/spiderbot/is_allowed_vent_crawl_item(var/obj/item/carried_item)
return carried_item != held_item if(carried_item == held_item)
return 0
return ..()
/mob/living/proc/handle_ventcrawl(var/obj/machinery/atmospherics/unary/vent_pump/vent_found = null, var/ignore_items = 0) // -- TLE -- Merged by Carn /mob/living/proc/handle_ventcrawl(var/obj/machinery/atmospherics/unary/vent_pump/vent_found = null, var/ignore_items = 0) // -- TLE -- Merged by Carn
if(stat) if(stat)