mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 19:13:30 +01:00
Merge pull request #16506 from SabreML/dragging-tweaks
Fixes 'Face while pulling' oversights
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user