Skyrat13 icon indicating copy to clipboard operation
Skyrat13 copied to clipboard

Null Rod Anti_Magic Variable is bugged for Block_Self

Open CaptainHooch opened this issue 4 years ago • 0 comments

Issue reported from Round ID: 2315 (Skyrat SS13 - Roleplay Server [Apply on Discord, Weekly Events])

Reporting client version: 513

While playing I noticed as a chaplain with a null rod anywhere on my person except my backpack any magic I try to cast is blocked by the null rod.

I did a code dive to try and find out why this was the case because I remember in previous rounds as chaplain where i encountered spell books and such that I could cast magic with the null rod out.

under https://github.com/Skyrat-SS13/Skyrat13/blob/master/code/game/objects/items/holy_weapons.dm

between lines 234 to 236 you can see the following

/obj/item/nullrod/Initialize() . = ..() AddComponent(/datum/component/anti_magic, TRUE, TRUE, FALSE, null, null, FALSE)

and on https://github.com/Skyrat-SS13/Skyrat13/blob/master/code/datums/components/anti_magic.dm

lines 1-9, and specifically lines 2-7 to represent the 6 True/False/Null variables for the null rods Anti-Magic it reads as

/datum/component/anti_magic var/magic = FALSE var/holy = FALSE var/psychic = FALSE var/allowed_slots = ~ITEM_SLOT_BACKPACK var/charges = INFINITY var/blocks_self = TRUE var/datum/callback/reaction var/datum/callback/expire

now if I understand this right the 6th Variable is Blocks_Self, which without comments on the code I can only guess is referencing that it blocks you from using magic on yourself or as yourself. The Null Rod's Anti-Magic Blocks_Self variable is set to FALSE, however the Null Rod is still blocking self casting of spells and powers including the smoke book that chaplains start with on Delta and Meta stations

This is obviously a bug that needs to be fixed, however I am unsure how to fix it. This bug really screws over chaplains who aim to use a magic via lavaland spell books, gifts from wizards (yes that's happened), the spell book they get in their office on delta and meta station, and spells given to them through prayer or through off the book TC trades to admins when traitor.

The Null Rod should only offer anti-magic protection from incomming magic, not also stop the holder of it from using magic themselves.

CaptainHooch avatar Sep 10 '20 07:09 CaptainHooch