From 6da9eb5451058bc4f1c9532c4f82d1080990111f Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Wed, 21 Feb 2018 17:47:19 -0500 Subject: [PATCH] Fix HUD creation and ventcrawling --- code/_onclick/hud/human.dm | 8 ++++---- .../mob/living/simple_animal/simple_hud.dm | 8 ++++---- code/modules/ventcrawl/ventcrawl.dm | 20 +++++++++++-------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index 83f23930dde..e1b141ecb75 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -75,7 +75,7 @@ ico = new(ui_style, "black") ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height()) - using = new /obj/screen( src ) + using = new /obj/screen() using.name = I_HELP using.icon = ico using.screen_loc = ui_acti @@ -87,7 +87,7 @@ ico = new(ui_style, "black") ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height()) - using = new /obj/screen( src ) + using = new /obj/screen() using.name = I_DISARM using.icon = ico using.screen_loc = ui_acti @@ -99,7 +99,7 @@ ico = new(ui_style, "black") ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2) - using = new /obj/screen( src ) + using = new /obj/screen() using.name = I_GRAB using.icon = ico using.screen_loc = ui_acti @@ -111,7 +111,7 @@ ico = new(ui_style, "black") ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2) - using = new /obj/screen( src ) + using = new /obj/screen() using.name = I_HURT using.icon = ico using.screen_loc = ui_acti diff --git a/code/modules/mob/living/simple_animal/simple_hud.dm b/code/modules/mob/living/simple_animal/simple_hud.dm index 72d7bf07a3a..cd3ed613557 100644 --- a/code/modules/mob/living/simple_animal/simple_hud.dm +++ b/code/modules/mob/living/simple_animal/simple_hud.dm @@ -74,7 +74,7 @@ ico = new(ui_style, "black") ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height()) - using = new /obj/screen( src ) + using = new /obj/screen() using.name = I_HELP using.icon = ico using.screen_loc = ui_acti @@ -86,7 +86,7 @@ ico = new(ui_style, "black") ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height()) - using = new /obj/screen( src ) + using = new /obj/screen() using.name = I_DISARM using.icon = ico using.screen_loc = ui_acti @@ -98,7 +98,7 @@ ico = new(ui_style, "black") ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2) - using = new /obj/screen( src ) + using = new /obj/screen() using.name = I_GRAB using.icon = ico using.screen_loc = ui_acti @@ -110,7 +110,7 @@ ico = new(ui_style, "black") ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2) - using = new /obj/screen( src ) + using = new /obj/screen() using.name = I_HURT using.icon = ico using.screen_loc = ui_acti diff --git a/code/modules/ventcrawl/ventcrawl.dm b/code/modules/ventcrawl/ventcrawl.dm index 8978305ec25..4741038cf4b 100644 --- a/code/modules/ventcrawl/ventcrawl.dm +++ b/code/modules/ventcrawl/ventcrawl.dm @@ -10,6 +10,7 @@ var/list/ventcrawl_machinery = list( /obj/item/weapon/holder, /obj/machinery/camera, /mob/living/simple_animal/borer, + /obj/screen ) /mob/living/var/list/icon/pipes_shown = list() @@ -41,18 +42,21 @@ var/list/ventcrawl_machinery = list( return FALSE . = ..() -/mob/living/proc/is_allowed_vent_crawl_item(var/obj/item/carried_item) +/mob/living/proc/is_allowed_vent_crawl_item(var/obj/carried_item) + //Ability master easy test for allowed (cheaper than istype) if(carried_item == ability_master) return 1 - var/list/allowed = list() - for(var/type in can_enter_vent_with) - var/list/types = typesof(type) - allowed += types + //Try to find it in our allowed list (istype includes subtypes) + var/listed = FALSE + for(var/test_type in can_enter_vent_with) + if(istype(carried_item,test_type)) + listed = TRUE + break - if(carried_item.type in allowed) - if(get_inventory_slot(carried_item) == 0) - return 1 + //Only allow it if it's "IN" the mob, not equipped on/being held + if(listed && !get_inventory_slot(carried_item)) + return 1 /mob/living/carbon/is_allowed_vent_crawl_item(var/obj/item/carried_item) if(carried_item in internal_organs)