From bc00c6d91b19e80806e725dae2583fb83419afc3 Mon Sep 17 00:00:00 2001 From: zxaber <37497534+zxaber@users.noreply.github.com> Date: Fri, 31 May 2024 10:48:57 -0700 Subject: [PATCH] Fixes Minebots ordered through cargo being stuck in idle mode (#83482) ## About The Pull Request - Presumably due to being spawned off-station on (I believe) the centcomm Z-level, Minebots ordered via points and that are delivered by the shuttle are stuck with their AI in the idle state. Rather than override a bunch of base-level AI code, I made clicking on them set their status to active. Right-clicking will set this without opening the bot's UI, while left-clicking will do both. Examine text now gives users a hint about this. - Removed text about feeding the mining bot ore to befriend it, as this functionality was removed in an earlier PR. ## Why It's Good For The Game Bugfix. ## Changelog :cl: fix: Minebots purchased via mining points are no longer stuck in idle mode. Clicking on them will activate their AI. spellcheck: Removed the examine text about feeding ore to minebots; this functionality was removed already. /:cl: --- code/modules/mob/living/basic/minebots/minebot.dm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/basic/minebots/minebot.dm b/code/modules/mob/living/basic/minebots/minebot.dm index 3361330915f0e..32f0ed80121f1 100644 --- a/code/modules/mob/living/basic/minebots/minebot.dm +++ b/code/modules/mob/living/basic/minebots/minebot.dm @@ -1,6 +1,6 @@ /mob/living/basic/mining_drone name = "\improper Nanotrasen minebot" - desc = "The instructions printed on the side read: This is a small robot used to support miners, can be set to search and collect loose ore, or to help fend off wildlife. Insert any type of ore into it to make it start listening to your commands!" + desc = "The instructions printed on the side read: This is a small robot used to support miners, can be set to search and collect loose ore, or to help fend off wildlife." gender = NEUTER icon = 'icons/mob/silicon/aibots.dmi' icon_state = "mining_drone" @@ -107,6 +107,8 @@ for(var/obj/item/borg/upgrade/modkit/modkit as anything in stored_gun.modkits) . += span_notice("There is \a [modkit] installed, using [modkit.cost]% capacity.") + if(ai_controller && ai_controller.ai_status == AI_STATUS_IDLE) + . += "The [src] appears to be in sleep mode. You can restore normal functions by tapping it." /mob/living/basic/mining_drone/welder_act(mob/living/user, obj/item/welder) @@ -132,7 +134,10 @@ /mob/living/basic/mining_drone/attack_hand(mob/living/carbon/human/user, list/modifiers) if(!user.combat_mode) - ui_interact(user) + if(ai_controller && ai_controller.ai_status == AI_STATUS_IDLE) + ai_controller.set_ai_status(AI_STATUS_ON) + if(LAZYACCESS(modifiers, LEFT_CLICK)) //Lets Right Click be specifically for re-enabling their AI (and avoiding the UI popup), while Left Click simply does both. + ui_interact(user) return return ..()