From 0ffc0aa634baa301fba87aed5150bf372717b5e2 Mon Sep 17 00:00:00 2001 From: Morrow Date: Thu, 21 Sep 2023 19:19:02 -0400 Subject: [PATCH 1/2] Initial --- code/game/objects/items/storage/storage.dm | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/code/game/objects/items/storage/storage.dm b/code/game/objects/items/storage/storage.dm index b1c79274913e..124fb91a8233 100644 --- a/code/game/objects/items/storage/storage.dm +++ b/code/game/objects/items/storage/storage.dm @@ -81,19 +81,7 @@ return ..() /obj/item/storage/proc/handle_mmb_open(mob/user) - if(!required_skill_for_nest_opening || !required_skill_level_for_nest_opening) - open(user) - return - - if(!istype(loc, /obj/item/storage)) - open(user) - return - - if(user?.skills.get_skill_level(required_skill_for_nest_opening) >= required_skill_level_for_nest_opening) - open(user) - return - - to_chat(user, SPAN_NOTICE("You can't seem to open [src] while it is in [loc].")) + open(user) /obj/item/storage/proc/return_inv() RETURN_TYPE(/list) @@ -171,6 +159,12 @@ /obj/item/storage/proc/open(mob/user) if(user.s_active == src) //Spam prevention. return + + if(istype(loc, /obj/item/storage) && required_skill_for_nest_opening) + if(!user || !user.skills || user.skills.get_skill_level(required_skill_for_nest_opening) < required_skill_level_for_nest_opening) + to_chat(user, SPAN_NOTICE("You can't seem to open [src] while it is in [loc].")) + return + if(!opened) orient2hud() opened = 1 From e5ed42da830044c40efcb985fb7df23634d057c8 Mon Sep 17 00:00:00 2001 From: Morrow Date: Sat, 23 Sep 2023 03:01:33 -0400 Subject: [PATCH 2/2] I SUPPOSE --- code/game/objects/items/storage/storage.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/storage/storage.dm b/code/game/objects/items/storage/storage.dm index 124fb91a8233..4361ffc8e4a9 100644 --- a/code/game/objects/items/storage/storage.dm +++ b/code/game/objects/items/storage/storage.dm @@ -161,7 +161,7 @@ return if(istype(loc, /obj/item/storage) && required_skill_for_nest_opening) - if(!user || !user.skills || user.skills.get_skill_level(required_skill_for_nest_opening) < required_skill_level_for_nest_opening) + if(!user || user.skills?.get_skill_level(required_skill_for_nest_opening) < required_skill_level_for_nest_opening) to_chat(user, SPAN_NOTICE("You can't seem to open [src] while it is in [loc].")) return @@ -413,7 +413,7 @@ var/list/global/item_storage_box_cache = list() /obj/item/storage/proc/can_hold_type(type_to_hold, mob/user) if(length(can_hold_skill)) for(var/can_hold_skill_typepath in can_hold_skill) - if(ispath(type_to_hold, can_hold_skill_typepath) && user?.skills.get_skill_level(can_hold_skill[can_hold_skill_typepath][SKILL_TYPE_INDEX]) >= can_hold_skill[can_hold_skill_typepath][SKILL_LEVEL_INDEX]) + if(ispath(type_to_hold, can_hold_skill_typepath) && user.skills?.get_skill_level(can_hold_skill[can_hold_skill_typepath][SKILL_TYPE_INDEX]) >= can_hold_skill[can_hold_skill_typepath][SKILL_LEVEL_INDEX]) return TRUE if(can_hold_skill_only) return FALSE