From 6b957ffbc3f947af57ca8c1d3a71e60baa79ce37 Mon Sep 17 00:00:00 2001 From: Ron Date: Tue, 3 Apr 2018 04:24:53 -0400 Subject: [PATCH] Fixes uplinks (#4517) Fixes traitors being able to see the ninja categories Fixes mercs being unable to see their special items Fixes #4238 --- code/datums/uplink/uplink_categories.dm | 14 ++++----- code/game/objects/items/devices/uplink.dm | 20 ++++++------ html/changelogs/Ron-UplinkFix.yml | 38 +++++++++++++++++++++++ 3 files changed, 54 insertions(+), 18 deletions(-) create mode 100644 html/changelogs/Ron-UplinkFix.yml diff --git a/code/datums/uplink/uplink_categories.dm b/code/datums/uplink/uplink_categories.dm index 6817b7464bb..fe3a6855a57 100644 --- a/code/datums/uplink/uplink_categories.dm +++ b/code/datums/uplink/uplink_categories.dm @@ -8,18 +8,16 @@ items = list() /datum/uplink_category/proc/can_view(obj/item/device/uplink/U) + if(!LAZYLEN(antag_roles)) + for(var/datum/uplink_item/item in items) + if(item.can_view(U)) + return 1 + return 0 + for(var/antag_role in antag_roles) var/datum/antagonist/antag = all_antag_types[antag_role] if(antag.is_antagonist(U.uplink_owner)) return 1 - - for(var/datum/uplink_item/item in items) - if(item.can_view(U)) - return 1 - - if(!LAZYLEN(antag_roles)) - return 1 - return 0 /datum/uplink_category/ammunition diff --git a/code/game/objects/items/devices/uplink.dm b/code/game/objects/items/devices/uplink.dm index c89f622c2a7..2c416601d94 100644 --- a/code/game/objects/items/devices/uplink.dm +++ b/code/game/objects/items/devices/uplink.dm @@ -318,16 +318,16 @@ A list of items and costs is stored under the datum of every game mode, alongsid // Includes normal radio uplink, multitool uplink, // implant uplink (not the implant tool) and a preset headset uplink. -/obj/item/device/radio/uplink/New() - hidden_uplink = new(src) +/obj/item/device/radio/uplink/New(var/loc, var/mind) + hidden_uplink = new(src, mind) icon_state = "radio" /obj/item/device/radio/uplink/attack_self(mob/user as mob) if(hidden_uplink) hidden_uplink.trigger(user) -/obj/item/device/multitool/uplink/New() - hidden_uplink = new(src) +/obj/item/device/multitool/uplink/New(var/loc, var/mind) + hidden_uplink = new(src, mind) /obj/item/device/multitool/uplink/attack_self(mob/user as mob) if(hidden_uplink) @@ -336,9 +336,9 @@ A list of items and costs is stored under the datum of every game mode, alongsid /obj/item/device/radio/headset/uplink traitor_frequency = 1445 -/obj/item/device/radio/headset/uplink/New() +/obj/item/device/radio/headset/uplink/New(var/loc, var/mind) ..() - hidden_uplink = new(src) + hidden_uplink = new(src, mind) hidden_uplink.uses = DEFAULT_TELECRYSTAL_AMOUNT /* @@ -353,9 +353,9 @@ A list of items and costs is stored under the datum of every game mode, alongsid flags = CONDUCT w_class = 2 -/obj/item/device/contract_uplink/New() +/obj/item/device/contract_uplink/New(var/loc, var/mind) ..() - hidden_uplink = new(src) + hidden_uplink = new(src, mind) hidden_uplink.uses = 0 hidden_uplink.nanoui_menu = 3 @@ -397,9 +397,9 @@ A list of items and costs is stored under the datum of every game mode, alongsid flags = CONDUCT w_class = 2 -/obj/item/device/ninja_uplink/New() +/obj/item/device/ninja_uplink/New(var/loc, var/mind) ..() - hidden_uplink = new(src) + hidden_uplink = new(src, mind) hidden_uplink.uses = DEFAULT_TELECRYSTAL_AMOUNT hidden_uplink.nanoui_menu = 1 diff --git a/html/changelogs/Ron-UplinkFix.yml b/html/changelogs/Ron-UplinkFix.yml new file mode 100644 index 00000000000..ee005f8e6cd --- /dev/null +++ b/html/changelogs/Ron-UplinkFix.yml @@ -0,0 +1,38 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +################################# + +# Your name. +author: Printer16 + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Ninja uplinks and merc uplinks now work properly. Check your tabs for items that were previously unavailable due to the bug." + - bugfix: "Traitors can no longer see categories they don't have access to."