From 91620218e4f58b80dd77195e0110f311c1f0046c Mon Sep 17 00:00:00 2001 From: Poojawa Date: Fri, 12 Oct 2018 05:37:36 -0500 Subject: [PATCH 1/4] some cherrypicked TG fixes and tweaks --- Dockerfile | 3 +- code/__DEFINES/mobs.dm | 2 + code/__DEFINES/tgs.dm | 56 ++++++++++++------- code/_compile_options.dm | 5 ++ code/datums/mood_events/needs_events.dm | 2 +- code/datums/position_point_vector.dm | 4 +- code/game/data_huds.dm | 2 +- code/game/gamemodes/objective.dm | 2 + code/game/machinery/_machinery.dm | 3 +- code/game/machinery/harvester.dm | 24 +++++--- .../atmospherics/environmental/LINDA_fire.dm | 2 +- code/modules/clothing/suits/utility.dm | 1 + code/modules/events/pirates.dm | 1 + .../food_and_drinks/food/snacks_other.dm | 2 +- .../kitchen_machinery/microwave.dm | 6 ++ .../mob/living/carbon/human/human_defines.dm | 1 + code/modules/mob/living/carbon/human/life.dm | 7 +++ dependencies.sh | 11 ++-- tools/mapmerge2/dmm.py | 5 +- 19 files changed, 96 insertions(+), 43 deletions(-) diff --git a/Dockerfile b/Dockerfile index 97d2ccf2e7..4d9443971e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ -FROM tgstation/byond:512.1448 as base -#above version must be the same as the one in dependencies.sh +FROM tgstation/byond:512.1453 as base FROM base as build_base diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index b7d467c385..62e1cf1b90 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -258,3 +258,5 @@ // /obj/item/bodypart on_mob_life() retval flag #define BODYPART_LIFE_UPDATE_HEALTH (1<<0) + +#define HUMAN_FIRE_STACK_ICON_NUM 3 diff --git a/code/__DEFINES/tgs.dm b/code/__DEFINES/tgs.dm index faa620613c..d24054a24c 100644 --- a/code/__DEFINES/tgs.dm +++ b/code/__DEFINES/tgs.dm @@ -10,6 +10,10 @@ //Comment this out once you've filled in the below #error TGS API unconfigured +//Uncomment this if you wish to allow the game to interact with TGS 3 +//This will raise the minimum required security level of your game to TGS_SECURITY_TRUSTED due to it utilizing call()() +//#define TGS_V3_API + //Required interfaces (fill in with your codebase equivalent): //create a global variable named `Name` and set it to `Value` @@ -47,7 +51,21 @@ #define TGS_EVENT_PORT_SWAP -2 //before a port change is about to happen, extra parameter is new port #define TGS_EVENT_REBOOT_MODE_CHANGE -1 //before a reboot mode change, extras parameters are the current and new reboot mode enums -//TODO +//See the descriptions for these codes here: https://github.com/tgstation/tgstation-server/blob/master/src/Tgstation.Server.Host/Components/EventType.cs +#define TGS_EVENT_REPO_RESET_ORIGIN 0 +#define TGS_EVENT_REPO_CHECKOUT 1 +#define TGS_EVENT_REPO_FETCH 2 +#define TGS_EVENT_REPO_MERGE_PULL_REQUEST 3 +#define TGS_EVENT_REPO_PRE_SYNCHRONIZE 4 +#define TGS_EVENT_BYOND_INSTALL_START 5 +#define TGS_EVENT_BYOND_INSTALL_FAIL 6 +#define TGS_EVENT_BYOND_ACTIVE_VERSION_CHANGE 7 +#define TGS_EVENT_COMPILE_START 8 +#define TGS_EVENT_COMPILE_CANCELLED 9 +#define TGS_EVENT_COMPILE_FAILURE 10 +#define TGS_EVENT_COMPILE_COMPLETE 11 +#define TGS_EVENT_INSTANCE_AUTO_UPDATE_START 12 +#define TGS_EVENT_REPO_MERGE_CONFLICT 13 //OTHER ENUMS @@ -74,8 +92,8 @@ /world/proc/TgsInitializationComplete() return -//Put this somewhere in /world/Topic(T, Addr, Master, Keys) that is always run before T is modified -#define TGS_TOPIC var/tgs_topic_return = TgsTopic(T); if(tgs_topic_return) return tgs_topic_return +//Put this at the start of /world/Topic() +#define TGS_TOPIC var/tgs_topic_return = TgsTopic(args[1]); if(tgs_topic_return) return tgs_topic_return //Call this at the beginning of world/Reboot(reason) /world/proc/TgsReboot() @@ -177,7 +195,7 @@ //Gets a list of connected tgs_chat_channel /world/proc/TgsChatChannelInfo() return - + //Sends a message to connected game chats //message: The message to send //channels: optional channels to limit the broadcast to @@ -201,24 +219,24 @@ The MIT License Copyright (c) 2017 Jordan Brown -Permission is hereby granted, free of charge, -to any person obtaining a copy of this software and -associated documentation files (the "Software"), to -deal in the Software without restriction, including -without limitation the rights to use, copy, modify, -merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom -the Software is furnished to do so, +Permission is hereby granted, free of charge, +to any person obtaining a copy of this software and +associated documentation files (the "Software"), to +deal in the Software without restriction, including +without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom +the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ \ No newline at end of file diff --git a/code/_compile_options.dm b/code/_compile_options.dm index 67bbe24e38..3ec2510cc7 100644 --- a/code/_compile_options.dm +++ b/code/_compile_options.dm @@ -3,6 +3,11 @@ //#define DATUMVAR_DEBUGGING_MODE //Enables the ability to cache datum vars and retrieve later for debugging which vars changed. +// Comment this out if you are debugging problems that might be obscured by custom error handling in world/Error +#ifdef DEBUG +#define USE_CUSTOM_ERROR_HANDLER +#endif + #ifdef TESTING #define DATUMVAR_DEBUGGING_MODE diff --git a/code/datums/mood_events/needs_events.dm b/code/datums/mood_events/needs_events.dm index c67f4bf160..75b7e6931f 100644 --- a/code/datums/mood_events/needs_events.dm +++ b/code/datums/mood_events/needs_events.dm @@ -4,7 +4,7 @@ mood_change = -4 /datum/mood_event/wellfed - description = "My belly feels round and full.\n" + description = "I'm stuffed!\n" mood_change = 6 /datum/mood_event/fed diff --git a/code/datums/position_point_vector.dm b/code/datums/position_point_vector.dm index 7d49db8429..a33d0d2225 100644 --- a/code/datums/position_point_vector.dm +++ b/code/datums/position_point_vector.dm @@ -186,8 +186,8 @@ /datum/point/vector/proc/increment(multiplier = 1) iteration++ - x += mpx * 1 - y += mpy * 1 + x += mpx * (multiplier) + y += mpy * (multiplier) /datum/point/vector/proc/return_vector_after_increments(amount = 7, multiplier = 1, force_simulate = FALSE) var/datum/point/vector/v = copy_to() diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm index 7a341ad69a..3af43ffb78 100644 --- a/code/game/data_huds.dm +++ b/code/game/data_huds.dm @@ -222,7 +222,7 @@ var/icon/I = icon(icon, icon_state, dir) holder.pixel_y = I.Height() - world.icon_size holder.icon_state = "hudno_id" - if(wear_id) + if(wear_id?.GetID()) holder.icon_state = "hud[ckey(wear_id.GetJobName())]" sec_hud_set_security_status() diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 41e429319c..7532d18d06 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -378,6 +378,8 @@ GLOBAL_LIST_EMPTY(objectives) for(var/datum/mind/M in owners) if(considered_alive(M)) return FALSE + if(M.current?.suiciding) //killing yourself ISN'T glorious. + return FALSE return TRUE /datum/objective/nuclear diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index 69edfcd5ec..9b5aa96b0b 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -91,6 +91,7 @@ Class Procs: verb_yell = "blares" pressure_resistance = 15 max_integrity = 200 + layer = BELOW_OBJ_LAYER //keeps shit coming out of the machine from ending up underneath it. anchored = TRUE interaction_flags_atom = INTERACT_ATOM_ATTACK_HAND | INTERACT_ATOM_UI_INTERACT @@ -120,7 +121,7 @@ Class Procs: armor = list("melee" = 25, "bullet" = 10, "laser" = 10, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 70) . = ..() GLOB.machines += src - + if(ispath(circuit, /obj/item/circuitboard)) circuit = new circuit circuit.apply_default_parts(src) diff --git a/code/game/machinery/harvester.dm b/code/game/machinery/harvester.dm index 17f355b5ad..1f40672e05 100644 --- a/code/game/machinery/harvester.dm +++ b/code/game/machinery/harvester.dm @@ -131,18 +131,24 @@ playsound(src, 'sound/machines/microwave/microwave-end.ogg', 100, 0) /obj/machinery/harvester/screwdriver_act(mob/living/user, obj/item/I) - . = ..() - if(.) - return TRUE - if(!state_open && !occupant) - if(default_deconstruction_screwdriver(user, "[initial(icon_state)]-o", initial(icon_state), I)) - return + . = TRUE + if(..()) + return + if(occupant) + to_chat(user, "[src] is currently occupied!") + return + if(state_open) + to_chat(user, "[src] must be closed to [panel_open ? "close" : "open"] it's maintenance hatch!") + return + if(default_deconstruction_screwdriver(user, "[initial(icon_state)]-o", initial(icon_state), I)) + return + return FALSE /obj/machinery/harvester/crowbar_act(mob/living/user, obj/item/I) if(default_pry_open(I)) - return + return TRUE if(default_deconstruction_crowbar(I)) - return + return TRUE /obj/machinery/harvester/default_pry_open(obj/item/I) //wew . = !(state_open || panel_open || (flags_1 & NODECONSTRUCT_1)) && I.tool_behaviour == TOOL_CROWBAR //We removed is_operational() here @@ -181,4 +187,4 @@ if(state_open) to_chat(user, "[src] must be closed before harvesting.") else if(!harvesting) - to_chat(user, "Alt-click [src] to start harvesting.") + to_chat(user, "Alt-click [src] to start harvesting.") \ No newline at end of file diff --git a/code/modules/atmospherics/environmental/LINDA_fire.dm b/code/modules/atmospherics/environmental/LINDA_fire.dm index 9ca822b5ce..f816866070 100644 --- a/code/modules/atmospherics/environmental/LINDA_fire.dm +++ b/code/modules/atmospherics/environmental/LINDA_fire.dm @@ -37,7 +37,7 @@ active_hotspot = new /obj/effect/hotspot(src) active_hotspot.temperature = exposed_temperature - active_hotspot.volume = exposed_volume + active_hotspot.volume = exposed_volume*25 active_hotspot.just_spawned = (current_cycle < SSair.times_fired) //remove just_spawned protection if no longer processing this cell diff --git a/code/modules/clothing/suits/utility.dm b/code/modules/clothing/suits/utility.dm index 1748813f56..b53ec05dda 100644 --- a/code/modules/clothing/suits/utility.dm +++ b/code/modules/clothing/suits/utility.dm @@ -20,6 +20,7 @@ body_parts_covered = CHEST|GROIN|LEGS|FEET|ARMS|HANDS allowed = list(/obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/extinguisher, /obj/item/crowbar) slowdown = 1 + armor = list("melee" = 15, "bullet" = 5, "laser" = 20, "energy" = 10, "bomb" = 20, "bio" = 10, "rad" = 20, "fire" = 100, "acid" = 50) flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT clothing_flags = STOPSPRESSUREDAMAGE | THICKMATERIAL heat_protection = CHEST|GROIN|LEGS|FEET|ARMS|HANDS diff --git a/code/modules/events/pirates.dm b/code/modules/events/pirates.dm index 80b8373887..910e94f680 100644 --- a/code/modules/events/pirates.dm +++ b/code/modules/events/pirates.dm @@ -148,6 +148,7 @@ new /obj/item/stack/spacecash/c200(drop_location()) credits_stored -= 200 to_chat(user,"You retrieve the siphoned credits!") + credits_stored = 0 /obj/machinery/shuttle_scrambler/proc/send_notification() diff --git a/code/modules/food_and_drinks/food/snacks_other.dm b/code/modules/food_and_drinks/food/snacks_other.dm index ecb3cfb2ba..a2f5b06042 100644 --- a/code/modules/food_and_drinks/food/snacks_other.dm +++ b/code/modules/food_and_drinks/food/snacks_other.dm @@ -156,7 +156,7 @@ icon_state = "mint" bitesize = 1 trash = /obj/item/trash/plate - list_reagents = list("minttoxin" = 1) + list_reagents = list("minttoxin" = 2) filling_color = "#800000" foodtype = TOXIC | SUGAR diff --git a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm index 3bcc8d7659..1445f79aa2 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm @@ -10,6 +10,8 @@ active_power_usage = 100 circuit = /obj/item/circuitboard/machine/microwave pass_flags = PASSTABLE + light_color = LIGHT_COLOR_YELLOW + light_power = 3 var/operating = FALSE // Is it on? var/dirty = 0 // = {0..100} Does it need cleaning? var/broken = 0 // ={0,1,2} How broken is it??? @@ -267,12 +269,14 @@ soundloop.start() operating = TRUE icon_state = "mw1" + set_light(1.5) updateUsrDialog() /obj/machinery/microwave/proc/abort() operating = FALSE // Turn it off again aferwards icon_state = "mw" updateUsrDialog() + set_light(0) soundloop.stop() /obj/machinery/microwave/proc/stop() @@ -298,6 +302,7 @@ if(prob(50)) new /obj/item/reagent_containers/food/snacks/badrecipe(src) qdel(S) + set_light(0) soundloop.stop() /obj/machinery/microwave/proc/broke() @@ -310,6 +315,7 @@ flags_1 = null //So you can't add condiments operating = FALSE // Turn it off again aferwards updateUsrDialog() + set_light(0) soundloop.stop() /obj/machinery/microwave/Topic(href, href_list) diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 763487f7ed..99615e9543 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -53,3 +53,4 @@ var/creamed = FALSE //to use with creampie overlays var/static/list/can_ride_typecache = typecacheof(list(/mob/living/carbon/human, /mob/living/simple_animal/slime, /mob/living/simple_animal/parrot)) var/lastpuke = 0 + var/last_fire_update diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 789a52250c..a50fb4fe79 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -122,6 +122,12 @@ ///FIRE CODE /mob/living/carbon/human/handle_fire() + if(!last_fire_update) + last_fire_update = fire_stacks + if((fire_stacks > HUMAN_FIRE_STACK_ICON_NUM && last_fire_update <= HUMAN_FIRE_STACK_ICON_NUM) || (fire_stacks <= HUMAN_FIRE_STACK_ICON_NUM && last_fire_update > HUMAN_FIRE_STACK_ICON_NUM)) + last_fire_update = fire_stacks + update_fire() + ..() if(dna) dna.species.handle_fire(src) @@ -154,6 +160,7 @@ /mob/living/carbon/human/ExtinguishMob() if(!dna || !dna.species.ExtinguishMob(src)) + last_fire_update = null ..() //END FIRE CODE diff --git a/dependencies.sh b/dependencies.sh index 1b61b37c88..644cdd3acc 100644 --- a/dependencies.sh +++ b/dependencies.sh @@ -3,11 +3,12 @@ #Project dependencies file #Final authority on what's required to fully build the project -#byond version -#note, this also needs to be changed in the Dockerfile's initial FROM command -#If someone has an idea for how to set that version within the Dockerfile itself without any other dependencies, feel free to PR it -export BYOND_MAJOR=512 -export BYOND_MINOR=1448 +# byond version +# Extracted from the Dockerfile. Change by editing Dockerfile's FROM command. +LIST=($(sed -n 's/.*byond:\([0-9]\+\)\.\([0-9]\+\).*/\1 \2/p' Dockerfile)) +export BYOND_MAJOR=${LIST[0]} +export BYOND_MINOR=${LIST[1]} +unset LIST #rust_g git tag export RUST_G_VERSION=0.4.1 diff --git a/tools/mapmerge2/dmm.py b/tools/mapmerge2/dmm.py index 421ffb4cd1..1c1f907171 100644 --- a/tools/mapmerge2/dmm.py +++ b/tools/mapmerge2/dmm.py @@ -370,7 +370,7 @@ def _parse(map_raw_text): continue elif in_comment_line: continue - elif char == "\t": + elif char in "\r\t": continue if char == "/" and not in_quote_block: @@ -478,6 +478,9 @@ def _parse(map_raw_text): # grid block for char in it: + if char == "\r": + continue + if in_coord_block: if char == ",": if reading_coord == "x": From a29e30a543cf9a1c685e685874babb35d2b174cc Mon Sep 17 00:00:00 2001 From: Poojawa Date: Fri, 12 Oct 2018 05:55:50 -0500 Subject: [PATCH 2/4] fixes runtimes --- code/game/objects/structures/crates_lockers/closets.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index d66d64cde5..a6a6c5f699 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -167,6 +167,10 @@ L.stop_pulling() else if(istype(AM, /obj/structure/closet)) return + + else if(istype(AM, /obj/effect)) + return + else if(isobj(AM)) if (istype(AM, /obj/item)) var/obj/item/I = AM From e8f12580606265c67d4523bdf221745975e577fe Mon Sep 17 00:00:00 2001 From: Poojawa Date: Fri, 12 Oct 2018 06:10:50 -0500 Subject: [PATCH 3/4] runtime unit test fix --- strings/phobia.json | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/strings/phobia.json b/strings/phobia.json index 3be9794bf9..8f4b476ecc 100644 --- a/strings/phobia.json +++ b/strings/phobia.json @@ -268,5 +268,31 @@ "let go", "i'll catch you", "slip" +"anime": [ + "anime", + "manga", + "baka", + "desu", + "sugoi", + "katana", + "weeb", + "otaku", + "catgirl", + "catgirls", + "ninja", + "uguu", + "waifu", + "husbando", + "best girl", + "worst girl", + "subs", + "dubs", + "season two when", + "cosplay", + "nya", + "nyaa", + "neet", + "ora", + "~" ] -} +} \ No newline at end of file From c03627033b90dda61d5dec4731ced44857fa4c0a Mon Sep 17 00:00:00 2001 From: Poojawa Date: Fri, 12 Oct 2018 06:15:59 -0500 Subject: [PATCH 4/4] feh --- strings/phobia.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/strings/phobia.json b/strings/phobia.json index 8f4b476ecc..3f56751333 100644 --- a/strings/phobia.json +++ b/strings/phobia.json @@ -268,6 +268,8 @@ "let go", "i'll catch you", "slip" + ], + "anime": [ "anime", "manga",