Merge pull request #16506 from SabreML/dragging-tweaks

Fixes 'Face while pulling' oversights
This commit is contained in:
variableundefined
2021-09-01 19:47:29 -05:00
committed by GitHub
3 changed files with 12 additions and 5 deletions
+4 -3
View File
@@ -16,9 +16,10 @@
desc = "A generic vending machine."
icon = 'icons/obj/vending.dmi'
icon_state = "generic"
layer = 2.9
anchored = 1
density = 1
layer = BELOW_OBJ_LAYER
anchored = TRUE
density = TRUE
face_while_pulling = TRUE
max_integrity = 300
integrity_failure = 100
armor = list(melee = 20, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 70)
@@ -13,6 +13,7 @@
use_power = IDLE_POWER_USE
idle_power_usage = 5
active_power_usage = 100
face_while_pulling = TRUE
/// The maximum number of items the fridge can hold. Multiplicated by the matter bin component's rating.
var/max_n_of_items = 1500
/// Associative list (/text => /number) tracking the amounts of a specific item held by the fridge.
+7 -2
View File
@@ -168,8 +168,13 @@
direct = newdir
n = get_step(mob, direct)
. = mob.SelfMove(n, direct, delay)
if(mob.pulling?.face_while_pulling)
var/prev_pulling_loc = null
if(mob.pulling)
prev_pulling_loc = mob.pulling.loc
. = mob.SelfMove(n, direct, delay) // The actual movement
if(prev_pulling_loc && mob.pulling?.face_while_pulling && (mob.pulling.loc != prev_pulling_loc))
mob.setDir(get_dir(mob, mob.pulling)) // Face welding tanks and stuff when pulling
else
mob.setDir(direct)