Skip to content

Commit

Permalink
Fixes Minebots ordered through cargo being stuck in idle mode (tgstat…
Browse files Browse the repository at this point in the history
…ion#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:
  • Loading branch information
zxaber authored May 31, 2024
1 parent 348f772 commit bc00c6d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions code/modules/mob/living/basic/minebots/minebot.dm
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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 <b>[modkit.cost]%</b> capacity.")
if(ai_controller && ai_controller.ai_status == AI_STATUS_IDLE)
. += "The [src] appears to be in <b>sleep mode</b>. You can restore normal functions by <b>tapping</b> it."


/mob/living/basic/mining_drone/welder_act(mob/living/user, obj/item/welder)
Expand All @@ -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 ..()

Expand Down

0 comments on commit bc00c6d

Please sign in to comment.