Skip to content

Commit

Permalink
cleanup(I hope)
Browse files Browse the repository at this point in the history
  • Loading branch information
wraith-54321 committed Apr 5, 2024
1 parent 5c765c1 commit 344890d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
9 changes: 8 additions & 1 deletion monkestation/code/modules/antagonists/_common/antag_datum.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
/datum/antagonist
///The key or list of keys that are valid to see our antag hud/of huds we can see
///The list of keys that are valid to see our antag hud/of huds we can see
var/list/hud_keys

///Set our hud_keys, please only use this proc when changing them, if override_old_keys is FALSE then we will simply add keys, otherwise we we set our keys to only be passed ones
/datum/antagonist/proc/set_hud_keys(list/keys, override_old_keys = FALSE)
if(!islist(keys))
keys = list(keys)

hud_keys = (override_old_keys ? keys : keys + hud_keys)

/datum/antagonist/proc/antag_token(datum/mind/hosts_mind, mob/spender)
SHOULD_CALL_PARENT(FALSE)
if(isobserver(spender))
Expand Down
11 changes: 3 additions & 8 deletions monkestation/code/modules/antagonists/_common/antag_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
if(!valid_keys)
return TRUE

var/islist_datum_keys = islist(antag_datum.hud_keys)
if(islist(valid_keys))
if(islist_datum_keys)
return length(valid_keys - antag_datum.hud_keys) != length(valid_keys)
return antag_datum.hud_keys in valid_keys
else if(islist_datum_keys)
return valid_keys in antag_datum.hud_keys
return valid_keys == antag_datum.hud_keys
if(!islist(valid_keys))
valid_keys = list(valid_keys)
return length(valid_keys - antag_datum.hud_keys) != length(valid_keys)

0 comments on commit 344890d

Please sign in to comment.