This commit is contained in:
SandPoot
2024-03-30 18:29:11 -03:00
parent 27d912aed3
commit ffe55f67b1
9 changed files with 34 additions and 33 deletions
+9 -8
View File
@@ -459,7 +459,7 @@
transfer_moles = pressure_delta*cabin_air.return_volume()/(cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION)
cabin_air.transfer_to(t_air, transfer_moles)
if(occupants)
if(LAZYLEN(occupants))
for(var/i in occupants)
var/mob/living/occupant = i
if(cell)
@@ -908,13 +908,14 @@
///Handles an actual AI (simple_animal mecha pilot) entering the mech
/obj/vehicle/sealed/mecha/proc/aimob_enter_mech(mob/living/simple_animal/hostile/syndicate/mecha_pilot/pilot_mob)
if(pilot_mob && pilot_mob.Adjacent(src))
if(LAZYLEN(occupants))
return
LAZYADD(occupants, src)
pilot_mob.mecha = src
pilot_mob.forceMove(src)
update_icon()
if(!pilot_mob?.Adjacent(src))
return
if(LAZYLEN(occupants))
return
LAZYSET(occupants, pilot_mob, NONE)
pilot_mob.mecha = src
pilot_mob.forceMove(src)
update_icon()
///Handles an actual AI (simple_animal mecha pilot) exiting the mech
/obj/vehicle/sealed/mecha/proc/aimob_exit_mech(mob/living/simple_animal/hostile/syndicate/mecha_pilot/pilot_mob)
+1 -1
View File
@@ -177,7 +177,7 @@ own integrity back to max. Shield is automatically dropped if we run out of powe
/obj/durand_shield/proc/activate(datum/source, mob/owner, list/signal_args)
SIGNAL_HANDLER
currentuser = owner
if(!chassis?.occupants)
if(!LAZYLEN(chassis?.occupants))
return
if(switching && !signal_args[1])
return
@@ -41,7 +41,7 @@
chassis.selected = null
update_chassis_page()
log_message("[src] is destroyed.", LOG_MECHA)
if(chassis.occupants)
if(!LAZYLEN(chassis?.occupants))
to_chat(chassis.occupants, "[icon2html(src, chassis.occupants)]<span class='danger'>[src] is destroyed!</span>")
playsound(chassis, destroy_sound, 50)
if(!detachable) //If we're a built-in nondetachable equipment, let's lock up the slot that we were in.
@@ -173,8 +173,7 @@
STOP_PROCESSING(SSfastprocess, src)
qdel(src)
if(istype(loc, /obj/vehicle/sealed/mecha/working) && scanning_time <= world.time)
var/obj/vehicle/sealed/mecha/working/mecha = loc
if(!mecha.occupants)
if(!LAZYLEN(chassis?.occupants))
return
scanning_time = world.time + equip_cooldown
mineral_scan_pulse(get_turf(src))
+1 -1
View File
@@ -156,7 +156,7 @@
for(var/occus in occupants)
var/mob/living/occupant = occus
occupant.update_mouse_pointer()
if(!equipment_disabled && occupants) //prevent spamming this message with back-to-back EMPs
if(!equipment_disabled && LAZYLEN(occupants)) //prevent spamming this message with back-to-back EMPs
to_chat(occupants, "<span=danger>Error -- Connection to equipment control unit has been lost.</span>")
addtimer(CALLBACK(src, TYPE_PROC_REF(/obj/vehicle/sealed/mecha, restore_equipment)), 3 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE)
equipment_disabled = 1