From f11deb5f91fc47fd55743143dacbb3a74b3b63c4 Mon Sep 17 00:00:00 2001 From: inselc Date: Sun, 30 Oct 2016 14:17:42 +0100 Subject: [PATCH 1/2] Bugfixes: hungry shades, IV drips, PDAs, smallbots and laptops (#1088) Fixes #1082 Fixes #1081 Fixes #979 Fixes #1063 Fixes #874 Fixes #1006 Fixes #1063 Fixes #929 --- code/game/machinery/computer3/laptop.dm | 10 +++--- code/game/machinery/iv_drip.dm | 2 ++ code/game/objects/items/devices/PDA/PDA.dm | 3 +- code/modules/mob/living/bot/bot.dm | 8 +++++ code/modules/mob/living/bot/cleanbot.dm | 13 ++++++-- code/modules/mob/living/bot/farmbot.dm | 20 +++++++++--- code/modules/mob/living/bot/floorbot.dm | 13 ++++++-- code/modules/mob/living/bot/medbot.dm | 31 ++++++++++++++----- code/modules/mob/living/bot/secbot.dm | 14 +++++++-- .../modules/mob/living/simple_animal/shade.dm | 1 + html/changelogs/inselc-PR-1088.yml | 10 ++++++ 11 files changed, 99 insertions(+), 26 deletions(-) create mode 100644 html/changelogs/inselc-PR-1088.yml diff --git a/code/game/machinery/computer3/laptop.dm b/code/game/machinery/computer3/laptop.dm index f05fdd9fdb8..75acc037632 100644 --- a/code/game/machinery/computer3/laptop.dm +++ b/code/game/machinery/computer3/laptop.dm @@ -34,7 +34,7 @@ set category = "Object" set src in view(1) - if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living)) + if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living) || !ishuman(usr)) usr << "\red You can't do that." return @@ -63,8 +63,7 @@ AltClick() - if(Adjacent(usr)) - open_computer() + open_computer() //Quickfix until Snapshot works out how he wants to redo power. ~Z /obj/item/device/laptop/verb/eject_id() @@ -123,7 +122,7 @@ set category = "Object" set src in view(1) - if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living)) + if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living) || !ishuman(usr)) usr << "\red You can't do that." return @@ -187,5 +186,4 @@ AltClick() - if(Adjacent(usr)) - close_computer() + close_computer() diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 666390dd432..370a442a3d9 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -125,6 +125,8 @@ update_icon() /obj/machinery/iv_drip/attack_hand(mob/user as mob) + if (isAI(user)) + return if(src.beaker) src.beaker.loc = get_turf(src) src.beaker = null diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 2295c430e61..32cca53419c 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -342,7 +342,8 @@ var/global/list/obj/item/device/pda/PDAs = list() return id /obj/item/device/pda/AltClick(var/mob/user) - verb_remove_id() + if (ismob(src.loc)) + verb_remove_id() /obj/item/device/pda/MouseDrop(obj/over_object as obj, src_location, over_location) var/mob/M = usr diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index d99566ebbed..1d5ea5914a0 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -61,6 +61,14 @@ else return 0 +/mob/living/bot/proc/has_ui_access(mob/user) + if (access_scanner.allowed(user)) + return 1 + if (!locked) + return 1 + if (isAI(user)) + return 1 + return 0 /mob/living/bot/attackby(var/obj/item/O, var/mob/user) if(O.GetID()) diff --git a/code/modules/mob/living/bot/cleanbot.dm b/code/modules/mob/living/bot/cleanbot.dm index 54eab09c455..cd40938cf4b 100644 --- a/code/modules/mob/living/bot/cleanbot.dm +++ b/code/modules/mob/living/bot/cleanbot.dm @@ -247,8 +247,12 @@ var/list/cleanbot_types // Going to use this to generate a list of types once th patrol_path = list() /mob/living/bot/cleanbot/attack_hand(var/mob/user) + if (!has_ui_access(user) && !emagged) + user << "The unit's interface refuses to unlock!" + return + var/dat - dat += "Automatic Station Cleaner v1.0

" + dat += "Automatic Station Cleaner v1.1

" dat += "Status: [on ? "On" : "Off"]
" dat += "Behaviour controls are [locked ? "locked" : "unlocked"]
" dat += "Maintenance panel is [open ? "opened" : "closed"]" @@ -259,7 +263,7 @@ var/list/cleanbot_types // Going to use this to generate a list of types once th dat += "Odd looking screw twiddled: [screwloose ? "Yes" : "No"]
" dat += "Weird button pressed: [oddbutton ? "Yes" : "No"]" - user << browse("Cleaner v1.0 controls[dat]", "window=autocleaner") + user << browse("Cleaner v1.1 controls[dat]", "window=autocleaner") onclose(user, "autocleaner") return @@ -268,6 +272,11 @@ var/list/cleanbot_types // Going to use this to generate a list of types once th return usr.set_machine(src) add_fingerprint(usr) + + if (!has_ui_access(usr) && !emagged) + usr << "Insufficient permissions." + return + switch(href_list["operation"]) if("start") if(on) diff --git a/code/modules/mob/living/bot/farmbot.dm b/code/modules/mob/living/bot/farmbot.dm index 0ea5d72b8d2..4090c93b18f 100644 --- a/code/modules/mob/living/bot/farmbot.dm +++ b/code/modules/mob/living/bot/farmbot.dm @@ -38,8 +38,13 @@ . = ..() if(.) return + + if (!has_ui_access(user)) + user << "The unit's interface refuses to unlock!" + return + var/dat = "" - dat += "Automatic Hyrdoponic Assisting Unit v1.0

" + dat += "Automatic Hyrdoponic Assisting Unit v1.1

" dat += "Status: [on ? "On" : "Off"]
" dat += "Water Tank: " if (tank) @@ -47,7 +52,7 @@ else dat += "Error: Watertank not found" dat += "
Behaviour controls are [locked ? "locked" : "unlocked"]
" - if(!locked) + if(!locked || issilicon(usr)) dat += "Watering controls:
" dat += "Water plants : [waters_trays ? "Yes" : "No"]
" dat += "Refill watertank : [refills_water ? "Yes" : "No"]
" @@ -60,7 +65,7 @@ dat += "Remove dead plants: [removes_dead ? "Yes" : "No"]
" dat += "
" - user << browse("Farmbot v1.0 controls[dat]", "window=autofarm") + user << browse("Farmbot v1.1 controls[dat]", "window=autofarm") onclose(user, "autofarm") return @@ -77,13 +82,18 @@ return usr.machine = src add_fingerprint(usr) - if((href_list["power"]) && (access_scanner.allowed(usr))) + + if (!has_ui_access(usr)) + usr << "Insufficient permissions." + return + + if(href_list["power"]) if(on) turn_off() else turn_on() - if(locked) + if(locked && !issilicon(usr)) return if(href_list["water"]) diff --git a/code/modules/mob/living/bot/floorbot.dm b/code/modules/mob/living/bot/floorbot.dm index 472d1a8619b..fd7b295a525 100644 --- a/code/modules/mob/living/bot/floorbot.dm +++ b/code/modules/mob/living/bot/floorbot.dm @@ -25,9 +25,13 @@ icon_state = "floorbot[on]e" /mob/living/bot/floorbot/attack_hand(var/mob/user) + if (!has_ui_access(user)) + user << "The unit's interface refuses to unlock!" + return + user.set_machine(src) var/dat - dat += "Automatic Station Floor Repairer v1.0

" + dat += "Automatic Station Floor Repairer v1.1

" dat += "Status: [src.on ? "On" : "Off"]
" dat += "Maintenance panel is [open ? "opened" : "closed"]
" //dat += "Tiles left: [amount]
" @@ -43,7 +47,7 @@ bmode = "Disabled" dat += "

Bridge Mode : [bmode]
" - user << browse("Repairbot v1.0 controls[dat]", "window=autorepair") + user << browse("Repairbot v1.1 controls[dat]", "window=autorepair") onclose(user, "autorepair") return @@ -58,6 +62,11 @@ return usr.set_machine(src) add_fingerprint(usr) + + if (!has_ui_access(usr)) + usr << "Insufficient permissions." + return + switch(href_list["operation"]) if("start") if (on) diff --git a/code/modules/mob/living/bot/medbot.dm b/code/modules/mob/living/bot/medbot.dm index 671f63002ec..86034df4c21 100644 --- a/code/modules/mob/living/bot/medbot.dm +++ b/code/modules/mob/living/bot/medbot.dm @@ -120,8 +120,12 @@ icon_state = "medibot[on]" /mob/living/bot/medbot/attack_hand(var/mob/user) + if (!has_ui_access(user)) + user << "The unit's interface refuses to unlock!" + return + var/dat - dat += "Automatic Medical Unit v1.0

" + dat += "Automatic Medical Unit v1.1

" dat += "Status: [on ? "On" : "Off"]
" dat += "Maintenance panel is [open ? "opened" : "closed"]
" dat += "Beaker: " @@ -152,7 +156,7 @@ dat += "The speaker switch is [vocal ? "on" : "off"]. Toggle
" - user << browse("Medibot v1.0 controls[dat]", "window=automed") + user << browse("Medibot v1.1 controls[dat]", "window=automed") onclose(user, "automed") return @@ -178,13 +182,18 @@ return usr.set_machine(src) add_fingerprint(usr) - if ((href_list["power"]) && access_scanner.allowed(usr)) + + if (!has_ui_access(usr)) + usr << "Insufficient permissions." + return + + if (href_list["power"]) if (on) turn_off() else turn_on() - else if((href_list["adj_threshold"]) && (!locked || issilicon(usr))) + else if(href_list["adj_threshold"] && (!locked || issilicon(usr))) var/adjust_num = text2num(href_list["adj_threshold"]) heal_threshold += adjust_num if(heal_threshold < 5) @@ -192,7 +201,7 @@ if(heal_threshold > 75) heal_threshold = 75 - else if((href_list["adj_inject"]) && (!locked || issilicon(usr))) + else if(href_list["adj_inject"] && (!locked || issilicon(usr))) var/adjust_num = text2num(href_list["adj_inject"]) injection_amount += adjust_num if(injection_amount < 5) @@ -200,7 +209,7 @@ if(injection_amount > 15) injection_amount = 15 - else if((href_list["use_beaker"]) && (!locked || issilicon(usr))) + else if(href_list["use_beaker"] && (!locked || issilicon(usr))) use_beaker = !use_beaker else if (href_list["eject"] && (!isnull(reagent_glass))) @@ -210,10 +219,10 @@ else usr << "You cannot eject the beaker because the panel is locked." - else if ((href_list["togglevoice"]) && (!locked || issilicon(usr))) + else if (href_list["togglevoice"] && (!locked || issilicon(usr))) vocal = !vocal - else if ((href_list["declaretreatment"]) && (!locked || issilicon(usr))) + else if (href_list["declaretreatment"] && (!locked || issilicon(usr))) declare_treatment = !declare_treatment attack_hand(usr) @@ -254,6 +263,12 @@ qdel(src) return +/mob/living/bot/medbot/turn_off() + patient = null + frustration = 0 + currently_healing = 0 + ..() + /mob/living/bot/medbot/proc/valid_healing_target(var/mob/living/carbon/human/H) if(H.stat == DEAD) // He's dead, Jim return null diff --git a/code/modules/mob/living/bot/secbot.dm b/code/modules/mob/living/bot/secbot.dm index feaf2743435..b5bc58acce9 100644 --- a/code/modules/mob/living/bot/secbot.dm +++ b/code/modules/mob/living/bot/secbot.dm @@ -39,7 +39,7 @@ var/next_destination = "__nearest__" // This is the next beacon's ID var/nearest_beacon // Tag of the beakon that we assume to be the closest one - var/bot_version = 1.3 + var/bot_version = 1.4 var/list/threat_found_sounds = new('sound/voice/bcriminal.ogg', 'sound/voice/bjustice.ogg', 'sound/voice/bfreeze.ogg') var/list/preparing_arrest_sounds = new('sound/voice/bgod.ogg', 'sound/voice/biamthelaw.ogg', 'sound/voice/bsecureday.ogg', 'sound/voice/bradio.ogg', 'sound/voice/binsult.ogg', 'sound/voice/bcreep.ogg') @@ -71,6 +71,9 @@ icon_state = "secbot[on]" /mob/living/bot/secbot/attack_hand(var/mob/user) + if (!has_ui_access(user)) + user << "The unit's interface refuses to unlock!" + return user.set_machine(src) var/dat dat += "Automatic Security Unit v[bot_version]

" @@ -95,11 +98,18 @@ usr.set_machine(src) add_fingerprint(usr) - if((href_list["power"]) && (access_scanner.allowed(usr))) + if (!has_ui_access(usr)) + usr << "Insufficient permissions." + return + + if(href_list["power"]) if(on) turn_off() else turn_on() + attack_hand(usr) + + if (locked && !issilicon(usr)) return switch(href_list["operation"]) diff --git a/code/modules/mob/living/simple_animal/shade.dm b/code/modules/mob/living/simple_animal/shade.dm index f8ed654b958..f057c571d26 100644 --- a/code/modules/mob/living/simple_animal/shade.dm +++ b/code/modules/mob/living/simple_animal/shade.dm @@ -27,6 +27,7 @@ status_flags = 0 faction = "cult" status_flags = CANPUSH + hunger_enabled = 0 /mob/living/simple_animal/shade/cultify() return diff --git a/html/changelogs/inselc-PR-1088.yml b/html/changelogs/inselc-PR-1088.yml new file mode 100644 index 00000000000..3e6b408fab1 --- /dev/null +++ b/html/changelogs/inselc-PR-1088.yml @@ -0,0 +1,10 @@ +author: inselc + +delete-after: True + +changes: + - bugfix: "Fixed hungry Shades." + - bugfix: "Fixed AI being able to interact with IV drips." + - bugfix: "Fixed Alt-Clicking PDA on ground displaying wrong message." + - bugfix: "Fixed smallbot controls access." + - bugfix: "Fixed mice being able to open and close laptop computers." From aa07e3482bd1cabc404b963fc0dea394c56e5f2f Mon Sep 17 00:00:00 2001 From: skull132 Date: Sun, 30 Oct 2016 13:15:39 -0400 Subject: [PATCH 2/2] Changelogs - 30OCT2016 --- html/changelog.html | 10 ++++++++++ html/changelogs/.all_changelog.yml | 7 +++++++ html/changelogs/inselc-PR-1088.yml | 10 ---------- 3 files changed, 17 insertions(+), 10 deletions(-) delete mode 100644 html/changelogs/inselc-PR-1088.yml diff --git a/html/changelog.html b/html/changelog.html index 028844d9812..719cc6dc897 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -56,6 +56,16 @@ -->
+

30 October 2016

+

inselc updated:

+
    +
  • Fixed hungry Shades.
  • +
  • Fixed AI being able to interact with IV drips.
  • +
  • Fixed Alt-Clicking PDA on ground displaying wrong message.
  • +
  • Fixed smallbot controls access.
  • +
  • Fixed mice being able to open and close laptop computers.
  • +
+

29 October 2016

inselc updated:

    diff --git a/html/changelogs/.all_changelog.yml b/html/changelogs/.all_changelog.yml index 70787c6278b..e0e76104234 100644 --- a/html/changelogs/.all_changelog.yml +++ b/html/changelogs/.all_changelog.yml @@ -2885,3 +2885,10 @@ DO NOT EDIT THIS FILE BY HAND! AUTOMATICALLY GENERATED BY ss13_genchangelog.py. - bugfix: Fixed invisible runes triggering message when trying to clean the tile they're on. - rscadd: Added Juggernaut ability to smash machines. +2016-10-30: + inselc: + - bugfix: Fixed hungry Shades. + - bugfix: Fixed AI being able to interact with IV drips. + - bugfix: Fixed Alt-Clicking PDA on ground displaying wrong message. + - bugfix: Fixed smallbot controls access. + - bugfix: Fixed mice being able to open and close laptop computers. diff --git a/html/changelogs/inselc-PR-1088.yml b/html/changelogs/inselc-PR-1088.yml deleted file mode 100644 index 3e6b408fab1..00000000000 --- a/html/changelogs/inselc-PR-1088.yml +++ /dev/null @@ -1,10 +0,0 @@ -author: inselc - -delete-after: True - -changes: - - bugfix: "Fixed hungry Shades." - - bugfix: "Fixed AI being able to interact with IV drips." - - bugfix: "Fixed Alt-Clicking PDA on ground displaying wrong message." - - bugfix: "Fixed smallbot controls access." - - bugfix: "Fixed mice being able to open and close laptop computers."