Merge pull request #1846 from yogstation13/upstream-merge-39261

[MIRROR] Fixes the pickup animation.
This commit is contained in:
morrowwolf
2018-07-22 00:55:38 -06:00
committed by GitHub

View File

@@ -776,37 +776,36 @@
return TRUE
/obj/item/proc/do_pickup_animation(atom/target)
/obj/item/proc/do_pickup_animation(turf/target)
set waitfor = FALSE
var/mutable_appearance/I = new(icon = src, loc = loc, layer = layer + 0.1)
var/image/I = image(icon = src, loc = loc, layer = layer + 0.1)
I.plane = GAME_PLANE
I.transform *= 0.75
I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
var/turf/T = get_turf(src)
var/direction
var/direction = get_dir(src, target)
var/to_x = 0
var/to_y = 0
if(direction & NORTH)
to_y = 32
else if(direction & SOUTH)
to_y = -32
if(direction & EAST)
to_x = 32
else if(direction & WEST)
to_x = -32
if(!direction)
to_y = 16
flick_overlay(I, GLOB.clients, 6)
var/static/matrix/M = new
var/matrix/M = new
M.Turn(pick(-30, 30))
animate(I, transform = M, time = 1)
sleep(1)
animate(I, transform = matrix(), time = 1)
sleep(1)
if(!QDELETED(T) && !QDELETED(target))
direction = get_dir(T, target)
if(direction & NORTH)
to_y = 32
else if(direction & SOUTH)
to_y = -32
if(direction & EAST)
to_x = 32
else if(direction & WEST)
to_x = -32
if(!direction)
to_y = 16
animate(I, alpha = 175, pixel_x = to_x, pixel_y = to_y, time = 3, easing = CUBIC_EASING)
sleep(1)
animate(I, alpha = 0, time = 1)