vgstation-coders / vgstation13

Butts
GNU Affero General Public License v3.0
266 stars 544 forks source link

Emag does not work on mobs #37281

Closed D3athrow-Issues closed 4 weeks ago

D3athrow-Issues commented 1 month ago

(WEB REPORT BY: dilt REMOTE: 172.93.101.77:7777)

Revision

e0f81a5e1eaede62ea7cd9488403f02f882015b6

Byond Version

515.1641

Description

Attempting to emag any mob did not work during this round, verified by decandeth. Mobs specifically defined as silicons or obj/machinery/bots

jwhitak commented 1 month ago

Calling @SECBATON-GRIFFON re: #37019

Dacendeth commented 1 month ago

borgs, mommis, beepsky all don't work properly, borgs and mommis covers cant be opened or emagged even if the cover is open, beepsky mentions something about its controls being opened but swiping again doesnt emag it

jwhitak commented 1 month ago

For PAI, the related bug, this line is likely the issue, which always will return true (unless it's somehow a superhacked robot) and skip the entire rest of the call. https://github.com/vgstation-coders/vgstation13/blob/e0f81a5e1eaede62ea7cd9488403f02f882015b6/code/game/machinery/bots/bots.dm#L719

jwhitak commented 1 month ago

This line is missing the emag_check arguments, so will always return FALSE. This explains the full silicons not getting emagged. https://github.com/vgstation-coders/vgstation13/blob/e0f81a5e1eaede62ea7cd9488403f02f882015b6/code/_onclick/item_attack.dm#L26

Most emag_checks are unncessary, this final check should catch all atom/movable cases where attackby isn't overridden or doesn't forget to call the parent.