From 3f110c5bf779796f72ffe9db156afffb902431a9 Mon Sep 17 00:00:00 2001 From: Ccomp5950 Date: Tue, 22 Jul 2014 19:05:04 -0500 Subject: [PATCH] screen_shake (meteors, etc.) made more robust and works with aiEyes Before: multiple screen_shake's could queue up prior to screenshake being set on the mob setting oldeye on the last one to queue up to be the random location from the previous screen shake so sometimes peoples clients were stuck on a location instead of back on the mob. Now we set screenshake before the spawn so we don't spawn up multiple screen_shakes on the same mob. Test: Be ghost, hammer the spawn meteors secret 10 times or so, watch as your camera returns back to your mob. Yay. Conflicts: code/modules/mob/mob_helpers.dm --- code/modules/mob/mob_helpers.dm | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index c094fb5335e..b65bc1a3e86 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -364,17 +364,25 @@ It's fairly easy to fix if dealing with single letters but not so much with comp /proc/shake_camera(mob/M, duration, strength=1) - spawn(0) - if(!M || !M.client || M.shakecamera) - return - var/oldeye=M.client.eye + if(!M || !M.client || M.shakecamera) + return + M.shakecamera = 1 + spawn(1) + + var/atom/oldeye=M.client.eye + var/aiEyeFlag = 0 + if(istype(oldeye, /mob/aiEye)) + aiEyeFlag = 1 + var/x - M.shakecamera = 1 for(x=0; x