Skip to content

Commit

Permalink
Fixes storage depth for internal storages (#4568)
Browse files Browse the repository at this point in the history
# About the pull request

Allows two depth storage removal for internal storages

# Explain why it's good for the game

Inconsistency bad

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog

:cl: Morrow
fix: Fixed storage depth for internal storages
/:cl:
  • Loading branch information
morrowwolf authored Oct 3, 2023
1 parent cc92037 commit f7b9853
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions code/_onclick/adjacent.dm
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ Quick adjacency (to turf):
/obj/item/Adjacent(atom/neighbor, recurse = 1)
if(neighbor == loc || (loc && neighbor == loc.loc))
return TRUE

// Internal storages have special relationships with the object they are connected to and we still want two depth adjacency for storages
if(istype(loc?.loc, /obj/item/storage/internal) && recurse > 0)
return loc.loc.Adjacent(neighbor, recurse)

if(issurface(loc))
return loc.Adjacent(neighbor, recurse) //Surfaces don't count as storage depth.
else if(istype(loc, /obj/item))
Expand Down

0 comments on commit f7b9853

Please sign in to comment.