Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
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
9 changes: 7 additions & 2 deletions code/modules/vending/_vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C
* * TRUE - all other cases
*/
/obj/machinery/vending/Initialize(mapload)
if(tilted)
src.tilt() // We don't need to set tilted to false before tilt because it will handle it.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need src here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No

var/build_inv = FALSE
if(!refill_canister)
circuit = null
Expand Down Expand Up @@ -463,6 +465,9 @@ GLOBAL_LIST_EMPTY(vending_products)
break

/obj/machinery/vending/proc/tilt(mob/fatty, crit=FALSE)
var/no_tipper = FALSE
if(!fatty)
no_tipper = TRUE
visible_message("<span class='danger'>[src] tips over!</span>")
tilted = TRUE
layer = ABOVE_MOB_LAYER
Expand All @@ -474,7 +479,7 @@ GLOBAL_LIST_EMPTY(vending_products)
if(forcecrit)
crit_case = forcecrit

if(in_range(fatty, src))
if(no_tipper || in_range(fatty, src))
for(var/mob/living/L in get_turf(fatty))
var/mob/living/carbon/C = L

Expand Down Expand Up @@ -542,7 +547,7 @@ GLOBAL_LIST_EMPTY(vending_products)
M.Turn(pick(90, 270))
transform = M

if(get_turf(fatty) != get_turf(src))
if(fatty && get_turf(fatty) != get_turf(src))
throw_at(get_turf(fatty), 1, 1, spin=FALSE)

/obj/machinery/vending/proc/untilt(mob/user)
Expand Down