From 96c790a81f2684c7abddb00f5c78b8d61857a2c7 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Sat, 2 Sep 2017 05:23:35 -0500 Subject: [PATCH 1/5] Unruntimes fdel on savefiles --- code/controllers/subsystem/persistence.dm | 6 +++--- code/modules/mob/living/carbon/monkey/punpun.dm | 4 ++-- code/modules/mob/living/simple_animal/friendly/cat.dm | 2 +- code/modules/mob/living/simple_animal/friendly/dog.dm | 2 +- .../mob/living/simple_animal/hostile/megafauna/colossus.dm | 2 +- code/modules/mob/living/simple_animal/parrot.dm | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/code/controllers/subsystem/persistence.dm b/code/controllers/subsystem/persistence.dm index 97c569b99b..0137953a65 100644 --- a/code/controllers/subsystem/persistence.dm +++ b/code/controllers/subsystem/persistence.dm @@ -26,7 +26,7 @@ SUBSYSTEM_DEF(persistence) var/savefile/secret_satchels = new /savefile("data/npc_saves/SecretSatchels.sav") var/sav_text secret_satchels[SSmapping.config.map_name] >> sav_text - fdel(secret_satchels) + fdel("data/npc_saves/SecretSatchels.sav") if(sav_text) old_secret_satchels = splittext(sav_text,"#") if(old_secret_satchels.len >= 20) @@ -79,7 +79,7 @@ SUBSYSTEM_DEF(persistence) if(!saved_json) return saved_messages = json_decode(saved_json) - fdel(chisel_messages_sav) + fdel("data/npc_saves/ChiselMessages.sav") else var/json_file = file("data/npc_saves/ChiselMessages[SSmapping.config.map_name].json") if(!fexists(json_file)) @@ -124,7 +124,7 @@ SUBSYSTEM_DEF(persistence) if(!saved_json) return saved_trophies = json_decode(saved_json) - fdel(S) + fdel("data/npc_saves/TrophyItems.sav") else var/json_file = file("data/npc_saves/TrophyItems.json") if(!fexists(json_file)) diff --git a/code/modules/mob/living/carbon/monkey/punpun.dm b/code/modules/mob/living/carbon/monkey/punpun.dm index da7ec5f186..2cf821093d 100644 --- a/code/modules/mob/living/carbon/monkey/punpun.dm +++ b/code/modules/mob/living/carbon/monkey/punpun.dm @@ -42,13 +42,13 @@ ..() /mob/living/carbon/monkey/punpun/proc/Read_Memory() - if(fexists("data/npc_saves/Punpun.sav")) + if(fexists("data/npc_saves/Punpun.sav")) //legacy compatability to convert old format to new var/savefile/S = new /savefile("data/npc_saves/Punpun.sav") S["ancestor_name"] >> ancestor_name S["ancestor_chain"] >> ancestor_chain S["relic_hat"] >> relic_hat S["relic_mask"] >> relic_mask - fdel(S) + fdel("data/npc_saves/Punpun.sav") else var/json_file = file("data/npc_saves/Punpun.json") if(!fexists(json_file)) diff --git a/code/modules/mob/living/simple_animal/friendly/cat.dm b/code/modules/mob/living/simple_animal/friendly/cat.dm index bea25ebe6d..0e0b811810 100644 --- a/code/modules/mob/living/simple_animal/friendly/cat.dm +++ b/code/modules/mob/living/simple_animal/friendly/cat.dm @@ -116,7 +116,7 @@ if(fexists("data/npc_saves/Runtime.sav")) //legacy compatability to convert old format to new var/savefile/S = new /savefile("data/npc_saves/Runtime.sav") S["family"] >> family - fdel(S) + fdel("data/npc_saves/Runtime.sav") else var/json_file = file("data/npc_saves/Runtime.json") if(!fexists(json_file)) diff --git a/code/modules/mob/living/simple_animal/friendly/dog.dm b/code/modules/mob/living/simple_animal/friendly/dog.dm index 370244f9d3..244e77d33a 100644 --- a/code/modules/mob/living/simple_animal/friendly/dog.dm +++ b/code/modules/mob/living/simple_animal/friendly/dog.dm @@ -333,7 +333,7 @@ S["age"] >> age S["record_age"] >> record_age S["saved_head"] >> saved_head - fdel(S) + fdel("data/npc_saves/Ian.sav") else var/json_file = file("data/npc_saves/Ian.json") if(!fexists(json_file)) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm index 78616fe007..66fd219358 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm @@ -292,7 +292,7 @@ Difficulty: Very Hard if(fexists("data/npc_saves/Blackbox.sav")) //legacy compatability to convert old format to new var/savefile/S = new /savefile("data/npc_saves/Blackbox.sav") S["stored_items"] >> stored_items - fdel(S) + fdel("data/npc_saves/Blackbox.sav") else var/json_file = file("data/npc_saves/Blackbox.json") if(!fexists(json_file)) diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index cd96dd2be8..a70a60a809 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -930,7 +930,7 @@ S["roundssurvived"] >> rounds_survived S["longestsurvival"] >> longest_survival S["longestdeathstreak"] >> longest_deathstreak - fdel(S) + fdel("data/npc_saves/Poly.sav") else var/json_file = file("data/npc_saves/Poly.json") if(!fexists(json_file)) From e3104358924bba70e0a641b0e8661eb734e18a7e Mon Sep 17 00:00:00 2001 From: LetterJay Date: Sat, 2 Sep 2017 05:26:22 -0500 Subject: [PATCH 2/5] UI objects should PIXEL_SCALE --- code/__DEFINES/misc.dm | 13 ++++++++++--- code/game/atoms_movable.dm | 7 ------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index cca88750b5..6ccebf83b0 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -315,9 +315,16 @@ GLOBAL_LIST_INIT(ghost_others_options, list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE #define APPEARANCE_CONSIDER_ALPHA ~RESET_ALPHA #define APPEARANCE_LONG_GLIDE LONG_GLIDE -// Consider these images/atoms as part of the UI/HUD -#define APPEARANCE_UI_IGNORE_ALPHA RESET_COLOR|RESET_TRANSFORM|NO_CLIENT_COLOR|RESET_ALPHA -#define APPEARANCE_UI RESET_COLOR|RESET_TRANSFORM|NO_CLIENT_COLOR +#ifndef PIXEL_SCALE +#define PIXEL_SCALE 0 +#if DM_VERSION >= 512 +#error HEY, PIXEL_SCALE probably exists now, remove this gross ass shim. +#endif +#endif + + // Consider these images/atoms as part of the UI/HUD +#define APPEARANCE_UI_IGNORE_ALPHA RESET_COLOR|RESET_TRANSFORM|NO_CLIENT_COLOR|RESET_ALPHA|PIXEL_SCALE +#define APPEARANCE_UI RESET_COLOR|RESET_TRANSFORM|NO_CLIENT_COLOR //Just space #define SPACE_ICON_STATE "[((x + y) ^ ~(x * y) + z) % 25]" diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index b4e6db1ebe..f4cbcda098 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -1,11 +1,4 @@ -#ifndef PIXEL_SCALE -#define PIXEL_SCALE 0 -#if DM_VERSION >= 512 -#error HEY, PIXEL_SCALE probably exists now, remove this gross ass shim. -#endif -#endif - /atom/movable layer = OBJ_LAYER var/last_move = null From 5d1c2c523b506c575ddb0f29215f8b023fcc1e08 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Sat, 2 Sep 2017 05:31:15 -0500 Subject: [PATCH 3/5] Fixes no drop implant --- code/modules/surgery/organs/augments_internal.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/surgery/organs/augments_internal.dm b/code/modules/surgery/organs/augments_internal.dm index d71cddd3e4..74c878f01d 100644 --- a/code/modules/surgery/organs/augments_internal.dm +++ b/code/modules/surgery/organs/augments_internal.dm @@ -52,7 +52,7 @@ if(active) for(var/obj/item/I in owner.held_items) if(!(I.flags_1 & NODROP_1)) - flags_1 += I + stored_items += I var/list/L = owner.get_empty_held_indexes() if(LAZYLEN(L) == owner.held_items.len) From d8679dbfcf60cf89937202c4c195a24893ef4634 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Sat, 2 Sep 2017 05:33:55 -0500 Subject: [PATCH 4/5] Prevents hallucinations revealing people's identity --- code/game/say.dm | 5 ++++- code/modules/flufftext/Hallucination.dm | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/code/game/say.dm b/code/game/say.dm index 1aaa3d6041..570974c0bc 100644 --- a/code/game/say.dm +++ b/code/game/say.dm @@ -44,7 +44,7 @@ GLOBAL_LIST_INIT(freqtospan, list( /atom/movable/proc/get_spans() return list() -/atom/movable/proc/compose_message(atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode) +/atom/movable/proc/compose_message(atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode, face_name = FALSE) //This proc uses text() because it is faster than appending strings. Thanks BYOND. //Basic span var/spanpart1 = "" @@ -54,6 +54,9 @@ GLOBAL_LIST_INIT(freqtospan, list( var/freqpart = radio_freq ? "\[[get_radio_name(radio_freq)]\] " : "" //Speaker name var/namepart = "[speaker.GetVoice()][speaker.get_alt_name()]" + if(face_name && ishuman(speaker)) + var/mob/living/carbon/human/H = speaker + namepart = "[H.get_face_name()]" //So "fake" speaking like in hallucinations does not give the speaker away if disguised //End name span. var/endspanpart = "" diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 0bac8e36ff..ca27d00c19 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -759,7 +759,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( people += H if(person) //Basic talk var/image/speech_overlay = image('icons/mob/talk.dmi', person, "default0", layer = ABOVE_MOB_LAYER) - var/message = target.compose_message(person,understood_language,pick(speak_messages),null,person.get_spans()) + var/message = target.compose_message(person,understood_language,pick(speak_messages),null,person.get_spans(),face_name = TRUE) feedback_details += "Type: Talk, Source: [person.real_name], Message: [message]" to_chat(target, message) if(target.client) @@ -771,7 +771,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( for(var/mob/living/carbon/human/H in GLOB.living_mob_list) humans += H person = pick(humans) - var/message = target.compose_message(person,understood_language,pick(radio_messages),"1459",person.get_spans()) + var/message = target.compose_message(person,understood_language,pick(radio_messages),"1459",person.get_spans(),face_name = TRUE) feedback_details += "Type: Radio, Source: [person.real_name], Message: [message]" to_chat(target, message) qdel(src) From 78ed8f0913c7603f53da438e9a90cacae0723bc7 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Sat, 2 Sep 2017 05:35:36 -0500 Subject: [PATCH 5/5] Fixes mecha drill not working on windoors. --- code/_onclick/adjacent.dm | 29 ++++++++++++++--------------- code/game/mecha/mecha.dm | 2 +- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/code/_onclick/adjacent.dm b/code/_onclick/adjacent.dm index 765e659c32..11ab21d21f 100644 --- a/code/_onclick/adjacent.dm +++ b/code/_onclick/adjacent.dm @@ -25,7 +25,7 @@ * If you are diagonally adjacent, ensure you can pass through at least one of the mutually adjacent square. * Passing through in this case ignores anything with the LETPASSTHROW pass flag, such as tables, racks, and morgue trays. */ -/turf/Adjacent(atom/neighbor, atom/target = null, atom/movable/mover = null) +/turf/Adjacent(atom/neighbor, atom/target = null, atom/movable/mover = null) var/turf/T0 = get_turf(neighbor) if(T0 == src) //same turf @@ -37,7 +37,7 @@ // Non diagonal case if(T0.x == x || T0.y == y) // Check for border blockages - return T0.ClickCross(get_dir(T0,src), border_only = 1, target_atom = target, mover = mover) && src.ClickCross(get_dir(src,T0), border_only = 1, target_atom = target, mover = mover) + return T0.ClickCross(get_dir(T0,src), border_only = 1, target_atom = target, mover = mover) && src.ClickCross(get_dir(src,T0), border_only = 1, target_atom = target, mover = mover) // Diagonal case var/in_dir = get_dir(T0,src) // eg. northwest (1+8) = 9 (00001001) @@ -45,16 +45,16 @@ var/d2 = in_dir&12 // eg. west (1+8)&12 (0000 1100) = 8 (0000 1000) for(var/d in list(d1,d2)) - if(!T0.ClickCross(d, border_only = 1, target_atom = target, mover = mover)) + if(!T0.ClickCross(d, border_only = 1, target_atom = target, mover = mover)) continue // could not leave T0 in that direction var/turf/T1 = get_step(T0,d) - if(!T1 || T1.density) - continue - if(!T1.ClickCross(get_dir(T1,src), border_only = 0, target_atom = target, mover = mover) || !T1.ClickCross(get_dir(T1,T0), border_only = 0, target_atom = target, mover = mover)) + if(!T1 || T1.density) + continue + if(!T1.ClickCross(get_dir(T1,src), border_only = 0, target_atom = target, mover = mover) || !T1.ClickCross(get_dir(T1,T0), border_only = 0, target_atom = target, mover = mover)) continue // couldn't enter or couldn't leave T1 - if(!src.ClickCross(get_dir(src,T1), border_only = 1, target_atom = target, mover = mover)) + if(!src.ClickCross(get_dir(src,T1), border_only = 1, target_atom = target, mover = mover)) continue // could not enter src return 1 // we don't care about our own density @@ -70,7 +70,7 @@ return TRUE if(!isturf(loc)) return FALSE - if(loc.Adjacent(neighbor,target = neighbor, mover = src)) + if(loc.Adjacent(neighbor,target = neighbor, mover = src)) return TRUE return FALSE @@ -85,20 +85,19 @@ /* This checks if you there is uninterrupted airspace between that turf and this one. - This is defined as any dense ON_BORDER_1 object, or any dense object without LETPASSTHROW. + This is defined as any dense ON_BORDER_1 object, or any dense object without LETPASSTHROW. The border_only flag allows you to not objects (for source and destination squares) */ -/turf/proc/ClickCross(target_dir, border_only, target_atom = null, atom/movable/mover = null) +/turf/proc/ClickCross(target_dir, border_only, target_atom = null, atom/movable/mover = null) for(var/obj/O in src) - if((mover && O.CanPass(mover,get_step(src,target_dir))) || (!mover && !O.density)) - continue - if(O == target_atom || (O.pass_flags & LETPASSTHROW)) //check if there's a dense object present on the turf + if((mover && O.CanPass(mover,get_step(src,target_dir))) || (!mover && !O.density)) + continue + if(O == target_atom || O == mover || (O.pass_flags & LETPASSTHROW)) //check if there's a dense object present on the turf continue // LETPASSTHROW is used for anything you can click through (or the firedoor special case, see above) - if( O.flags_1&ON_BORDER_1) // windows are on border, check them first + if( O.flags_1&ON_BORDER_1) // windows are on border, check them first if( O.dir & target_dir || O.dir & (O.dir-1) ) // full tile windows are just diagonals mechanically return 0 //O.dir&(O.dir-1) is false for any cardinal direction, but true for diagonal ones - else if( !border_only ) // dense, not on border, cannot pass over return 0 return 1 diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 9142549d0a..aa5788192e 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -421,7 +421,7 @@ target = safepick(view(3,target)) if(!target) return - if(!target.Adjacent(src)) + if(!Adjacent(target)) if(selected && selected.is_ranged()) if(selected.action(target,params)) selected.start_cooldown()