diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 69546fc8e49..d6888a9ce8b 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -322,7 +322,7 @@ var/list/ai_list = list() C.post_status("shuttle") /mob/living/silicon/ai/cancel_camera() - src.view_core() + view_core() /mob/living/silicon/ai/verb/toggle_anchor() set category = "AI Commands" @@ -896,15 +896,16 @@ var/list/ai_list = list() /mob/living/silicon/ai/proc/malfhacked(obj/machinery/power/apc/apc) malfhack = null - malfhacking = FALSE + malfhacking = 0 + clear_alert("hackingapc") if(!istype(apc) || qdeleted(apc) || apc.stat & BROKEN) - src << "Hack aborted. The designated APC no longer exists on the \ - power network." + src << "Hack aborted. The designated APC no \ + longer exists on the power network." playsound(get_turf(src), 'sound/machines/buzz-two.ogg', 50, 1) else if(apc.aidisabled) - src << "Hack aborted. \The [apc] is no longer responding \ - to our systems." + src << "Hack aborted. \The [apc] is no \ + longer responding to our systems." playsound(get_turf(src), 'sound/machines/buzz-sigh.ogg', 50, 1) else malf_picker.processing_time += 10 diff --git a/code/modules/mob/living/silicon/ai/freelook/eye.dm b/code/modules/mob/living/silicon/ai/freelook/eye.dm index 03cbf964dea..116fa63d716 100644 --- a/code/modules/mob/living/silicon/ai/freelook/eye.dm +++ b/code/modules/mob/living/silicon/ai/freelook/eye.dm @@ -76,7 +76,7 @@ //user.unset_machine() //Uncomment this if it causes problems. //user.lightNearbyCamera() - if (user.camera_light_on) + if(user.camera_light_on) user.light_cameras() // Return to the Core. @@ -86,13 +86,11 @@ cameraFollow = null unset_machine() - if(src.eyeobj && src.loc) - src.eyeobj.loc = src.loc - else + if(!eyeobj || !eyeobj.loc || qdeleted(eyeobj)) src << "ERROR: Eyeobj not found. Creating new eye..." - src.eyeobj = new(src.loc) - src.eyeobj.ai = src - src.eyeobj.name = "[src.name] (AI Eye)" // Give it a name + eyeobj = new(loc) + eyeobj.ai = src + eyeobj.name = "[src.name] (AI Eye)" // Give it a name eyeobj.setLoc(loc) @@ -107,4 +105,4 @@ /mob/camera/aiEye/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, list/spans) if(relay_speech && speaker && ai && !radio_freq && speaker != ai && near_camera(speaker)) - ai.relay_speech(message, speaker, message_langs, raw_message, radio_freq, spans) \ No newline at end of file + ai.relay_speech(message, speaker, message_langs, raw_message, radio_freq, spans) diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index fab6fdef09a..d24a997edaf 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -11,11 +11,14 @@ update_gravity(mob_has_gravity()) - if(malfhack) - if(malfhack.aidisabled) - src << "ERROR: APC access disabled, hack attempt canceled." - malfhacking = 0 - malfhack = null + if(malfhack && malfhack.aidisabled) + deltimer(malfhacking) + // This proc handles cleanup of screen notifications and + // messenging the client + malfhacked(malfhack) + + if(!eyeobj || qdeleted(eyeobj) || !eyeobj.loc) + view_core() if(machine) machine.check_eye(src) @@ -156,10 +159,9 @@ blind_eyes(1) update_sight() src << "You've lost power!" - spawn(20) - start_RestorePowerRoutine() + addtimer(src, "start_RestorePowerRoutine", 20) #undef POWER_RESTORATION_OFF #undef POWER_RESTORATION_START #undef POWER_RESTORATION_SEARCH_APC -#undef POWER_RESTORATION_APC_FOUND \ No newline at end of file +#undef POWER_RESTORATION_APC_FOUND diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index dbb03ae14bb..f88b2582bb0 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -414,7 +414,6 @@ playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1) visible_message("[M] took a swipe at [src]!", \ "[M] took a swipe at [src]!") - return /mob/living/silicon/attack_animal(mob/living/simple_animal/M) if(..()) @@ -440,7 +439,6 @@ /mob/living/silicon/attack_larva(mob/living/carbon/alien/larva/L) if(L.a_intent == "help") visible_message("[L.name] rubs its head against [src].") - return /mob/living/silicon/attack_hulk(mob/living/carbon/human/user) if(user.a_intent == "harm") diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 782692e0ac0..98848e70452 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -796,8 +796,7 @@ return malf << "Beginning override of APC systems. This takes some time, and you cannot perform other actions during the process." malf.malfhack = src - malf.malfhacking = TRUE - addtimer(malf, "malfhacked", 600, FALSE, src) + malf.malfhacking = addtimer(malf, "malfhacked", 600, FALSE, src) var/obj/screen/alert/hackingapc/A A = malf.throw_alert("hackingapc", /obj/screen/alert/hackingapc)