Porting putnams ventcrawling PR and Fix (#13571)

* Porting putnams rage

* And the bugfix
This commit is contained in:
MrJWhit
2020-10-17 05:39:25 -04:00
committed by GitHub
parent 393ab62c6b
commit 4fdacf0560
2 changed files with 10 additions and 9 deletions
+8
View File
@@ -100,6 +100,14 @@
return held_items.Find(I)
///Find number of held items, multihand compatible
/mob/proc/get_num_held_items()
. = 0
for(var/i in 1 to held_items.len)
if(held_items[i])
.++
//Sad that this will cause some overhead, but the alias seems necessary
//*I* may be happy with a million and one references to "indexes" but others won't be
/mob/proc/is_holding(obj/item/I)
+2 -9
View File
@@ -59,15 +59,8 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, typecacheof(list(
if(!client)
return
if(iscarbon(src) && ventcrawler < 2)//It must have atleast been 1 to get this far
var/failed = 0
var/list/items_list = get_equipped_items(include_pockets = TRUE)
if(items_list.len)
failed = 1
for(var/obj/item/I in held_items)
failed = 1
break
if(failed)
if(iscarbon(src) && ventcrawler == VENTCRAWLER_NUDE)
if(length(get_equipped_items(include_pockets = TRUE)) || get_num_held_items())
to_chat(src, "<span class='warning'>You can't crawl around in the ventilation ducts with items!</span>")
return