Skip to content

Commit

Permalink
[MIRROR] Fix robocontrol access runtime (#1655)
Browse files Browse the repository at this point in the history
* Fix robocontrol access runtime (#82242)

## About The Pull Request


![image](https://github.com/tgstation/tgstation/assets/51863163/568fa916-d167-4038-b0e8-7b0870754bf9)

`check_access` expects an item, such as an ID card, to... check access.
Not a mob.

We can circumvent this entirely by using `allowed`.

But this has an averse effect in that `allowed` will only check the
user's ID, not the ID in the mod PC.

So we need to run a separate check of `check_access` for the computer ID
card.

## Changelog

:cl: Melbert
fix: Robocontrol should work better.
/:cl:

---------

Co-authored-by: san7890 <[email protected]>

* Fix robocontrol access runtime

---------

Co-authored-by: MrMelbert <[email protected]>
Co-authored-by: san7890 <[email protected]>
  • Loading branch information
3 people authored and StealsThePRs committed Mar 27, 2024
1 parent c527703 commit 0b78831
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
for(var/mob/living/simple_animal/bot/simple_bot as anything in GLOB.bots_list)
if(!is_valid_z_level(current_turf, get_turf(simple_bot)) || !(simple_bot.bot_mode_flags & BOT_MODE_REMOTE_ENABLED)) //Only non-emagged bots on the same Z-level are detected!
continue
if(computer && !simple_bot.check_access(user)) // Only check Bots we can access)
if(!simple_bot.allowed(user) && !simple_bot.check_access(computer.computer_id_slot)) // Only check Bots we can access
continue
var/list/newbot = list(
"name" = simple_bot.name,
Expand Down

0 comments on commit 0b78831

Please sign in to comment.