Skip to content

Commit

Permalink
Fixes bot and borg emagging (and bot pAI slotting) (#37288)
Browse files Browse the repository at this point in the history
* Fixes bot and borg emagging

* Update code/game/machinery/bots/bots.dm

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

---------

Co-authored-by: jwhitak <[email protected]>
  • Loading branch information
SECBATON-GRIFFON and jwhitak authored Oct 21, 2024
1 parent 7d37889 commit 2e2472d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
visible_message("<span class='danger'>[src] has been hit by [user] with [W].</span>")
if(W.material_type)
W.material_type.on_use(W, src, user)
return emag_check()
return emag_check(W,user)

/atom/movable/proc/emag_check(obj/item/weapon/card/emag/E, mob/user)
if(can_emag() && istype(E) && E.canUse(user,src))
Expand Down
8 changes: 4 additions & 4 deletions code/game/machinery/bots/bots.dm
Original file line number Diff line number Diff line change
Expand Up @@ -622,12 +622,14 @@
src.explode()

/obj/machinery/bot/emag_act(mob/user)
if(locked)
if(emagged >= 2)
return
if(locked)

Check failure on line 627 in code/game/machinery/bots/bots.dm

View workflow job for this annotation

GitHub Actions / Run linters

possible unreachable code here
locked = 0
emagged = 1
if(user)
to_chat(user, "<span class='warning'>You remove [src]'s control restrictions. Opening up its maintenance panel and swiping again will cause [src] to malfunction.</span>")
if(!locked && open)
else if(open)
emagged = 2
if(user)
to_chat(user, "<span class='warning'>You cause a malfunction in [src]'s behavioral matrix.</span>")
Expand Down Expand Up @@ -716,8 +718,6 @@
to_chat(user, "<span class='notice'>Unable to repair with the maintenance panel closed.</span>")
else
to_chat(user, "<span class='notice'>[src] does not need a repair.</span>")
else if (emagged < 2)
emag_check(W,user)
else
if(isobj(W))
W.on_attack(src, user)
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/silicon/robot/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,8 @@
updateicon()
else
to_chat(user, "<span class='warning'>Access denied.</span>")
else if(isEmag(W))
emag_check(W,user)
else if(istype(W, /obj/item/device/toner))
if(toner >= tonermax)
to_chat(user, "The toner level of [src] is at its highest level possible")
Expand Down

0 comments on commit 2e2472d

Please sign in to comment.