Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drag-n-drop hotfix #4468

Merged
merged 2 commits into from
Sep 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions code/game/objects/items/storage/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down