From 63fb3f29eaafa84b404b92f9bf2c4a10b22bfe8a Mon Sep 17 00:00:00 2001 From: DJSnapshot Date: Sat, 2 Nov 2013 12:26:34 -0700 Subject: [PATCH] mecha fixes --- code/_onclick/click.dm | 4 +++- code/_onclick/hud/screen_objects.dm | 8 +++++++- code/game/objects/items/weapons/storage/storage.dm | 3 +++ code/modules/mob/mob.dm | 2 ++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 5ece365899c..5ce15be96e7 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -55,7 +55,7 @@ if(modifiers["ctrl"]) CtrlClickOn(A) return - + if(stat || paralysis || stunned || weakened) return @@ -65,6 +65,8 @@ return if(istype(loc,/obj/mecha)) + if(!locate(/turf) in list(A,A.loc)) // Prevents inventory from being drilled + return var/obj/mecha/M = loc return M.click_action(A,src) diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 54a7974d586..a0dcfb9ae9c 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -47,7 +47,7 @@ return 1 if(usr.next_move >= world.time) return - usr.next_move = world.time + 10 + usr.next_move = world.time + 6 if(usr.stat || usr.restrained() || usr.stunned || usr.lying) return 1 @@ -86,6 +86,8 @@ return 1 if(usr.stat || usr.paralysis || usr.stunned || usr.weakened) return 1 + if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech + return 1 if(master) var/obj/item/I = usr.get_active_hand() if(I) @@ -207,6 +209,8 @@ usr.hud_used.hidden_inventory_update() if("equip") + if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech + return 1 if(ishuman(usr)) var/mob/living/carbon/human/H = usr H.quick_equip() @@ -421,6 +425,8 @@ return 1 if(usr.stat || usr.paralysis || usr.stunned || usr.weakened) return 1 + if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech + return 1 switch(name) if("r_hand") if(iscarbon(usr)) diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index f31c92b8bb1..9ad77255dc4 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -27,6 +27,9 @@ if (ishuman(usr) || ismonkey(usr)) //so monkeys can take off their backpacks -- Urist var/mob/M = usr + if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech + return + if(over_object == M && Adjacent(M)) // this must come before the screen objects only block orient2hud(M) // dunno why it wasn't before if(M.s_active) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 648dfa309b4..8f9623565f3 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -240,6 +240,8 @@ var/list/slot_equipment_priority = list( \ set category = "Object" set src = usr + if(istype(loc,/obj/mecha)) return + if(hand) var/obj/item/W = l_hand if (W)