Skip to content

Commit

Permalink
[MIRROR] fixes bots having all access (#2015)
Browse files Browse the repository at this point in the history
* fixes bots having all access (#82678)

## About The Pull Request
a recent change to silicon access meant all bots, simple and basic had
all access from roundstart

## Why It's Good For The Game
fixes bots having all access
Fixes tgstation/tgstation#82671

## Changelog
:cl:
fix: basic bots no longer start with all access
/:cl:

* fixes bots having all access

---------

Co-authored-by: Ben10Omintrix <[email protected]>
  • Loading branch information
2 people authored and StealsThePRs committed Apr 16, 2024
1 parent 58be6f7 commit c32b871
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
12 changes: 8 additions & 4 deletions code/modules/mob/living/basic/bots/_bots.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ GLOBAL_LIST_INIT(command_strings, list(
"home" = "RETURN HOME",
))

#define SENTIENT_BOT_RESET_TIMER 45 SECONDS

/mob/living/basic/bot
icon = 'icons/mob/silicon/aibots.dmi'
layer = MOB_LAYER
Expand Down Expand Up @@ -101,7 +103,7 @@ GLOBAL_LIST_INIT(command_strings, list(
AddElement(/datum/element/relay_attackers)
RegisterSignal(src, COMSIG_MOVABLE_MOVED, PROC_REF(handle_loop_movement))
RegisterSignal(src, COMSIG_ATOM_WAS_ATTACKED, PROC_REF(after_attacked))
RegisterSignal(src, COMSIG_MOB_TRIED_ACCESS, PROC_REF(attempt_access))
RegisterSignal(src, COMSIG_OBJ_ALLOWED, PROC_REF(attempt_access))
ADD_TRAIT(src, TRAIT_NO_GLIDE, INNATE_TRAIT)
GLOB.bots_list += src

Expand Down Expand Up @@ -758,9 +760,7 @@ GLOBAL_LIST_INIT(command_strings, list(
/mob/living/basic/bot/proc/attempt_access(mob/bot, obj/door_attempt)
SIGNAL_HANDLER

if(door_attempt.check_access(access_card))
return ACCESS_ALLOWED
return ACCESS_DISALLOWED
return (door_attempt.check_access(access_card) ? COMPONENT_OBJ_ALLOW : COMPONENT_OBJ_DISALLOW)

/mob/living/basic/bot/proc/generate_speak_list()
return null
Expand All @@ -783,6 +783,8 @@ GLOBAL_LIST_INIT(command_strings, list(
access_card.set_access(access_to_grant)
speak("Responding.", radio_channel)
update_bot_mode(new_mode = BOT_SUMMON)
if(client) //if we're sentient, we reset ourselves after a short period
addtimer(CALLBACK(src, PROC_REF(bot_reset)), SENTIENT_BOT_RESET_TIMER)
return TRUE

/mob/living/basic/bot/proc/set_ai_caller(mob/living/caller)
Expand All @@ -809,3 +811,5 @@ GLOBAL_LIST_INIT(command_strings, list(

/mob/living/basic/bot/proc/on_bot_movement(atom/movable/source, atom/oldloc, dir, forced)
return

#undef SENTIENT_BOT_RESET_TIMER
7 changes: 7 additions & 0 deletions code/modules/mob/living/basic/bots/bot_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@
if(. & AI_CONTROLLER_INCOMPATIBLE)
return
RegisterSignal(new_pawn, COMSIG_BOT_RESET, PROC_REF(reset_bot))
RegisterSignal(new_pawn, COMSIG_AI_BLACKBOARD_KEY_CLEARED(BB_BOT_SUMMON_TARGET), PROC_REF(clear_summon))

/datum/ai_controller/basic_controller/bot/proc/clear_summon()
SIGNAL_HANDLER

var/mob/living/basic/bot/bot_pawn = pawn
bot_pawn.bot_reset()

/datum/ai_controller/basic_controller/bot/able_to_run()
var/mob/living/basic/bot/bot_pawn = pawn
Expand Down
3 changes: 1 addition & 2 deletions code/modules/mob/living/basic/bots/medbot/medbot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
icon_state = "medibot0"
base_icon_state = "medibot"
density = FALSE
anchored = FALSE
health = 20
maxHealth = 20
speed = 2
light_power = 0.8
light_color = "#99ccff"
pass_flags = PASSMOB | PASSFLAPS
status_flags = CANSTUN
status_flags = (CANPUSH | CANSTUN)
ai_controller = /datum/ai_controller/basic_controller/bot/medbot

req_one_access = list(ACCESS_ROBOTICS, ACCESS_MEDICAL)
Expand Down

0 comments on commit c32b871

Please sign in to comment.