Stops manned turrets from firing when the user unbuckles themselves from the turret (#31754)
* The clown is drunk, and the cards of death wait on him * Update power.dm
This commit is contained in:
committed by
CitadelStationBot
parent
98a583b249
commit
7045809aa2
@@ -68,14 +68,15 @@
|
|||||||
START_PROCESSING(SSfastprocess, src)
|
START_PROCESSING(SSfastprocess, src)
|
||||||
|
|
||||||
/obj/machinery/manned_turret/process()
|
/obj/machinery/manned_turret/process()
|
||||||
if(!LAZYLEN(buckled_mobs))
|
if (!update_positioning())
|
||||||
return PROCESS_KILL
|
return PROCESS_KILL
|
||||||
update_positioning()
|
|
||||||
|
|
||||||
/obj/machinery/manned_turret/proc/update_positioning()
|
/obj/machinery/manned_turret/proc/update_positioning()
|
||||||
|
if (!LAZYLEN(buckled_mobs))
|
||||||
|
return FALSE
|
||||||
var/mob/living/controller = buckled_mobs[1]
|
var/mob/living/controller = buckled_mobs[1]
|
||||||
if(!istype(controller))
|
if(!istype(controller))
|
||||||
return
|
return FALSE
|
||||||
var/client/C = controller.client
|
var/client/C = controller.client
|
||||||
if(C)
|
if(C)
|
||||||
var/atom/A = C.mouseObject
|
var/atom/A = C.mouseObject
|
||||||
@@ -143,7 +144,7 @@
|
|||||||
addtimer(CALLBACK(src, /obj/machinery/manned_turret/.proc/fire_helper, user), i*rate_of_fire)
|
addtimer(CALLBACK(src, /obj/machinery/manned_turret/.proc/fire_helper, user), i*rate_of_fire)
|
||||||
|
|
||||||
/obj/machinery/manned_turret/proc/fire_helper(mob/user)
|
/obj/machinery/manned_turret/proc/fire_helper(mob/user)
|
||||||
if(user.incapacitated())
|
if(user.incapacitated() || !(user in buckled_mobs))
|
||||||
return
|
return
|
||||||
update_positioning() //REFRESH MOUSE TRACKING!!
|
update_positioning() //REFRESH MOUSE TRACKING!!
|
||||||
var/turf/targets_from = get_turf(src)
|
var/turf/targets_from = get_turf(src)
|
||||||
|
|||||||
@@ -278,7 +278,7 @@
|
|||||||
//dist_check - set to only shock mobs within 1 of source (vendors, airlocks, etc.)
|
//dist_check - set to only shock mobs within 1 of source (vendors, airlocks, etc.)
|
||||||
//No animations will be performed by this proc.
|
//No animations will be performed by this proc.
|
||||||
/proc/electrocute_mob(mob/living/carbon/M, power_source, obj/source, siemens_coeff = 1, dist_check = FALSE)
|
/proc/electrocute_mob(mob/living/carbon/M, power_source, obj/source, siemens_coeff = 1, dist_check = FALSE)
|
||||||
if(ismecha(M.loc))
|
if(!M || ismecha(M.loc))
|
||||||
return 0 //feckin mechs are dumb
|
return 0 //feckin mechs are dumb
|
||||||
if(dist_check)
|
if(dist_check)
|
||||||
if(!in_range(source,M))
|
if(!in_range(source,M))
|
||||||
|
|||||||
Reference in New Issue
Block a user