diff --git a/code/game/objects/items/storage/storage.dm b/code/game/objects/items/storage/storage.dm index b1c79274913e..4361ffc8e4a9 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?.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 @@ -419,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