Merge pull request #35419 from kevinz000/patch-446

fixes beam rifle zooming
This commit is contained in:
Jordan Brown
2018-02-08 16:18:29 -05:00
committed by CitadelStationBot
parent 99c42a142c
commit 623513ab24
+13 -11
View File
@@ -91,7 +91,7 @@
set_user(user)
. = ..()
/obj/item/gun/energy/beam_rifle/dropped()
/obj/item/gun/energy/beam_rifle/dropped(mob/user)
set_user()
. = ..()
@@ -142,18 +142,20 @@
return
zooming = TRUE
/obj/item/gun/energy/beam_rifle/proc/stop_zooming()
/obj/item/gun/energy/beam_rifle/proc/stop_zooming(mob/user)
if(zooming)
zooming = FALSE
reset_zooming()
reset_zooming(user)
/obj/item/gun/energy/beam_rifle/proc/reset_zooming()
if(!check_user(FALSE))
return
/obj/item/gun/energy/beam_rifle/proc/reset_zooming(mob/user)
if(!user)
user = current_user
if(!user || !user.client)
return FALSE
zoom_animating = 0
animate(current_user.client, pixel_x = 0, pixel_y = 0, 0, FALSE, LINEAR_EASING, ANIMATION_END_NOW)
animate(user.client, pixel_x = 0, pixel_y = 0, 0, FALSE, LINEAR_EASING, ANIMATION_END_NOW)
zoom_current_view_increase = 0
current_user.client.change_view(CONFIG_GET(string/default_view))
user.client.change_view(CONFIG_GET(string/default_view))
zooming_angle = 0
current_zoom_x = 0
current_zoom_y = 0
@@ -271,17 +273,17 @@
zooming_angle = lastangle
start_zooming()
/obj/item/gun/energy/beam_rifle/proc/stop_aiming()
/obj/item/gun/energy/beam_rifle/proc/stop_aiming(mob/user)
set waitfor = FALSE
aiming_time_left = aiming_time
aiming = FALSE
QDEL_LIST(current_tracers)
stop_zooming()
stop_zooming(user)
/obj/item/gun/energy/beam_rifle/proc/set_user(mob/user)
if(user == current_user)
return
stop_aiming()
stop_aiming(current_user)
if(istype(current_user))
LAZYREMOVE(current_user.mousemove_intercept_objects, src)
current_user = null