Fixes many instances of lying mob getting shifted up (pixel_y reset to 0) by adding a lying_pixel_offset var to mob/living.

Removes the delay when toggling resting, sleeping and pouncing, the mob sprite will now update instantly.
This commit is contained in:
phil235
2015-03-30 23:14:21 +02:00
parent 314e9424ae
commit 12a729adcd
8 changed files with 35 additions and 14 deletions
@@ -44,12 +44,14 @@
/obj/structure/stool/bed/nest/post_buckle_mob(mob/living/M)
if(M == buckled_mob)
M.pixel_y += 6
M.pixel_x += 2
M.pixel_y = initial(M.pixel_y) + 6
M.pixel_x = initial(M.pixel_x) + 2
overlays += image('icons/mob/alien.dmi', "nestoverlay", layer=6)
else
M.pixel_x -= 2
M.pixel_x = initial(M.pixel_x)
M.pixel_y = initial(M.pixel_y)
if(M.lying)
M.pixel_y = M.lying_pixel_offset
overlays.Cut()
/obj/structure/stool/bed/nest/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
@@ -59,10 +59,8 @@
icon = 'icons/obj/rollerbed.dmi'
icon_state = "down"
anchored = 0
var/const/buckled_pixel_y_offset = 6 //Mobs buckled will have their pixel_y offset by this much
/obj/structure/stool/bed/roller/post_buckle_mob(mob/M)
/obj/structure/stool/bed/roller/post_buckle_mob(mob/living/M)
if(M == buckled_mob)
density = 1
icon_state = "up"
@@ -72,7 +70,7 @@
icon_state = "down"
M.pixel_y = initial(M.pixel_y)
if(M.lying)
M.pixel_y -= buckled_pixel_y_offset
M.pixel_y = M.lying_pixel_offset
/obj/item/roller