From a42bb6f726c478b35e88cbc97ffc051ec9735492 Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Sun, 4 Jul 2021 15:46:22 -0400 Subject: [PATCH 1/8] Fix excessive table merge, convert climbers lazy --- code/game/objects/structures.dm | 14 ++++++------- code/game/objects/structures/fitness_vr.dm | 24 +++++++++++----------- code/game/objects/structures/ledges.dm | 8 ++++---- code/game/objects/structures/railing.dm | 8 ++++---- code/modules/tables/tables.dm | 2 ++ 5 files changed, 29 insertions(+), 27 deletions(-) diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index 87332c776f..f023f3e395 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -7,7 +7,7 @@ var/climb_delay = 3.5 SECONDS var/breakable var/parts - var/list/climbers = list() + var/list/climbers var/block_turf_edges = FALSE // If true, turf edge icons will not be made on the turf this occupies. var/list/connections = list("0", "0", "0", "0") @@ -35,7 +35,7 @@ if(H.species.can_shred(user)) attack_generic(user,1,"slices") - if(climbers.len && !(user in climbers)) + if(LAZYLEN(climbers) && !(user in climbers)) user.visible_message("[user.name] shakes \the [src].", \ "You shake \the [src].") structure_shaken() @@ -103,21 +103,21 @@ return usr.visible_message("[user] starts climbing onto \the [src]!") - climbers |= user + LAZYDISTINCTADD(climbers, user) if(!do_after(user,(issmall(user) ? climb_delay * 0.6 : climb_delay))) - climbers -= user + LAZYREMOVE(climbers, user) return if (!can_climb(user, post_climb_check=1)) - climbers -= user + LAZYREMOVE(climbers, user) return usr.forceMove(get_turf(src)) if (get_turf(user) == get_turf(src)) usr.visible_message("[user] climbs onto \the [src]!") - climbers -= user + LAZYREMOVE(climbers, user) /obj/structure/proc/structure_shaken() for(var/mob/living/M in climbers) @@ -204,7 +204,7 @@ if(can_visually_connect_to(S)) if(S.can_visually_connect()) if(propagate) - //S.update_connections() //Not here + S.update_connections() S.update_icon() dirs += get_dir(src, S) diff --git a/code/game/objects/structures/fitness_vr.dm b/code/game/objects/structures/fitness_vr.dm index 6459cd469b..99978fe27c 100644 --- a/code/game/objects/structures/fitness_vr.dm +++ b/code/game/objects/structures/fitness_vr.dm @@ -26,14 +26,14 @@ return usr.visible_message("[user] starts climbing onto \the [src]!") - climbers |= user + LAZYDISTINCTADD(climbers, user) if(!do_after(user,(issmall(user) ? 20 : 34))) - climbers -= user + LAZYREMOVE(climbers, user) return if(!can_climb(user, post_climb_check=1)) - climbers -= user + LAZYREMOVE(climbers, user) return if(get_turf(user) == get_turf(src)) @@ -42,7 +42,7 @@ usr.forceMove(get_turf(src)) usr.visible_message("[user] climbed over \the [src]!") - climbers -= user + LAZYREMOVE(climbers, user) /obj/structure/fitness/boxing_ropes/can_climb(var/mob/living/user, post_climb_check=0) //Sets it to keep people from climbing over into the next turf if it is occupied. if(!..()) @@ -84,14 +84,14 @@ return usr.visible_message("[user] starts climbing onto \the [src]!") - climbers |= user + LAZYDISTINCTADD(climbers, user) if(!do_after(user,(issmall(user) ? 20 : 34))) - climbers -= user + LAZYREMOVE(climbers, user) return if(!can_climb(user, post_climb_check=1)) - climbers -= user + LAZYREMOVE(climbers, user) return if(get_turf(user) == get_turf(src)) @@ -100,7 +100,7 @@ usr.forceMove(get_turf(src)) usr.visible_message("[user] climbed over \the [src]!") - climbers -= user + LAZYREMOVE(climbers, user) /obj/structure/fitness/boxing_ropes_bottom/can_climb(var/mob/living/user, post_climb_check=0) if(!..()) @@ -143,14 +143,14 @@ return usr.visible_message("[user] starts climbing onto \the [src]!") - climbers |= user + LAZYDISTINCTADD(climbers, user) if(!do_after(user,(issmall(user) ? 20 : 34))) - climbers -= user + LAZYREMOVE(climbers, user) return if(!can_climb(user, post_climb_check=1)) - climbers -= user + LAZYREMOVE(climbers, user) return if(get_turf(user) == get_turf(src)) @@ -159,7 +159,7 @@ usr.forceMove(get_turf(src)) usr.visible_message("[user] climbed over \the [src]!") - climbers -= user + LAZYREMOVE(climbers, user) /obj/structure/fitness/boxing_turnbuckle/can_climb(var/mob/living/user, post_climb_check=0) if(!..()) diff --git a/code/game/objects/structures/ledges.dm b/code/game/objects/structures/ledges.dm index 1afa2efb01..cf7c88fc48 100644 --- a/code/game/objects/structures/ledges.dm +++ b/code/game/objects/structures/ledges.dm @@ -55,14 +55,14 @@ return usr.visible_message("[user] starts climbing onto \the [src]!") - climbers |= user + LAZYDISTINCTADD(climbers, user) if(!do_after(user,(issmall(user) ? 20 : 34))) - climbers -= user + LAZYREMOVE(climbers, user) return if(!can_climb(user, post_climb_check=1)) - climbers -= user + LAZYREMOVE(climbers, user) return if(get_turf(user) == get_turf(src)) @@ -71,7 +71,7 @@ usr.forceMove(get_turf(src)) usr.visible_message("[user] climbed over \the [src]!") - climbers -= user + LAZYREMOVE(climbers, user) /obj/structure/ledge/can_climb(var/mob/living/user, post_climb_check=0) if(!..()) diff --git a/code/game/objects/structures/railing.dm b/code/game/objects/structures/railing.dm index e039f7806f..c6c1e1aea5 100644 --- a/code/game/objects/structures/railing.dm +++ b/code/game/objects/structures/railing.dm @@ -286,14 +286,14 @@ return usr.visible_message("[user] starts climbing onto \the [src]!") - climbers |= user + LAZYDISTINCTADD(climbers, user) if(!do_after(user,(issmall(user) ? 20 : 34))) - climbers -= user + LAZYREMOVE(climbers, user) return if(!can_climb(user, post_climb_check=1)) - climbers -= user + LAZYREMOVE(climbers, user) return if(get_turf(user) == get_turf(src)) @@ -303,7 +303,7 @@ usr.visible_message("[user] climbed over \the [src]!") if(!anchored) take_damage(maxhealth) // Fatboy - climbers -= user + LAZYREMOVE(climbers, user) /obj/structure/railing/can_climb(var/mob/living/user, post_climb_check=0) if(!..()) diff --git a/code/modules/tables/tables.dm b/code/modules/tables/tables.dm index e37b684d3d..47cba8bf46 100644 --- a/code/modules/tables/tables.dm +++ b/code/modules/tables/tables.dm @@ -333,6 +333,8 @@ var/list/table_icon_cache = list() return FALSE if(istype(src,/obj/structure/table/bench) && !istype(S,/obj/structure/table/bench)) return FALSE + if(istype(src,/obj/structure/table/rack) && !istype(S,/obj/structure/table/rack)) + return FALSE if(istype(S,/obj/structure/table)) return TRUE ..() From 9b0bf7c4e8bacfc4d790c895b6022d7a6ac4677e Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Sun, 4 Jul 2021 15:55:02 -0400 Subject: [PATCH 2/8] Fix taur tail paths --- .../mob/new_player/sprite_accessories_taur_vr.dm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/modules/mob/new_player/sprite_accessories_taur_vr.dm b/code/modules/mob/new_player/sprite_accessories_taur_vr.dm index fc3994b528..67ecb4254a 100644 --- a/code/modules/mob/new_player/sprite_accessories_taur_vr.dm +++ b/code/modules/mob/new_player/sprite_accessories_taur_vr.dm @@ -83,7 +83,7 @@ extra_overlay2 = "synthwolf_glow" //icon_sprite_tag = "synthwolf" -/datum/sprite_accessory/tail/taur/ch/wolf/fatsynthwolf +/datum/sprite_accessory/tail/taur/ch_wolf_fatsynthwolf name = "Fat SynthWolf dual-color (Taur)" icon_state = "fatsynthwolf_s" extra_overlay = "fatsynthwolf_markings" @@ -219,11 +219,11 @@ extra_overlay = "lizard_markings" //icon_sprite_tag = "lizard2c" -/datum/sprite_accessory/tail/taur/ch/lizard/fat +/datum/sprite_accessory/tail/taur/ch_lizard_fat name = "Fat Lizard (Taur)" icon_state = "fatlizard_s" -/datum/sprite_accessory/tail/taur/ch/lizard/fat_2c +/datum/sprite_accessory/tail/taur/ch_lizard_fat_2c name = "Fat Lizard (Taur, dual-color)" icon_state = "fatlizard_s" extra_overlay= "fatlizard_markings" @@ -235,7 +235,7 @@ extra_overlay2 = "synthlizard_glow" //icon_sprite_tag = "synthlizard" -/datum/sprite_accessory/tail/taur/ch/lizard/fatsynthlizard +/datum/sprite_accessory/tail/taur/ch_lizard_fatsynthlizard name = "Fat SynthLizard dual-color (Taur)" icon_state = "fatsynthlizard_s" extra_overlay = "fatsynthlizard_markings" @@ -326,7 +326,7 @@ extra_overlay2 = "synthfeline_glow" //icon_sprite_tag = "synthfeline" -/datum/sprite_accessory/tail/taur/ch/feline/fatsynthfeline +/datum/sprite_accessory/tail/taur/ch_feline_fatsynthfeline name = "Fat SynthFeline dual-color (Taur)" icon_state = "fatsynthfeline_s" extra_overlay = "fatsynthfeline_markings" From a7e586b8a24f455063326e55cad917dac0a607fe Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Sun, 4 Jul 2021 15:58:19 -0400 Subject: [PATCH 3/8] Subtype them to fix #10705 --- .../mob/new_player/sprite_accessories_taur_vr.dm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/new_player/sprite_accessories_taur_vr.dm b/code/modules/mob/new_player/sprite_accessories_taur_vr.dm index 67ecb4254a..1652fbfca9 100644 --- a/code/modules/mob/new_player/sprite_accessories_taur_vr.dm +++ b/code/modules/mob/new_player/sprite_accessories_taur_vr.dm @@ -57,7 +57,7 @@ suit_sprites = 'icons/mob/taursuits_wolf_vr.dmi' icon_sprite_tag = "wolf" -/datum/sprite_accessory/tail/taur/fatwolf +/datum/sprite_accessory/tail/taur/wolf/fatwolf name = "Fat Wolf (Taur)" icon_state = "fatwolf_s" icon_sprite_tag = "wolf" //This could be modified later. @@ -83,7 +83,7 @@ extra_overlay2 = "synthwolf_glow" //icon_sprite_tag = "synthwolf" -/datum/sprite_accessory/tail/taur/ch_wolf_fatsynthwolf +/datum/sprite_accessory/tail/taur/wolf/fatsynthwolf name = "Fat SynthWolf dual-color (Taur)" icon_state = "fatsynthwolf_s" extra_overlay = "fatsynthwolf_markings" @@ -219,11 +219,11 @@ extra_overlay = "lizard_markings" //icon_sprite_tag = "lizard2c" -/datum/sprite_accessory/tail/taur/ch_lizard_fat +/datum/sprite_accessory/tail/taur/lizard/fatlizard name = "Fat Lizard (Taur)" icon_state = "fatlizard_s" -/datum/sprite_accessory/tail/taur/ch_lizard_fat_2c +/datum/sprite_accessory/tail/taur/lizard/fatlizard_2c name = "Fat Lizard (Taur, dual-color)" icon_state = "fatlizard_s" extra_overlay= "fatlizard_markings" @@ -235,7 +235,7 @@ extra_overlay2 = "synthlizard_glow" //icon_sprite_tag = "synthlizard" -/datum/sprite_accessory/tail/taur/ch_lizard_fatsynthlizard +/datum/sprite_accessory/tail/taur/lizard/fatsynthlizard name = "Fat SynthLizard dual-color (Taur)" icon_state = "fatsynthlizard_s" extra_overlay = "fatsynthlizard_markings" @@ -326,7 +326,7 @@ extra_overlay2 = "synthfeline_glow" //icon_sprite_tag = "synthfeline" -/datum/sprite_accessory/tail/taur/ch_feline_fatsynthfeline +/datum/sprite_accessory/tail/taur/feline/fatsynthfeline name = "Fat SynthFeline dual-color (Taur)" icon_state = "fatsynthfeline_s" extra_overlay = "fatsynthfeline_markings" From d5bd389cb449691d1728d38016b6ddb442996501 Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Sun, 4 Jul 2021 17:50:20 -0400 Subject: [PATCH 4/8] Fixes #10874, Fixes #10871 --- code/game/turfs/turf_changing.dm | 1 + code/modules/maps/tg/reader.dm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/code/game/turfs/turf_changing.dm b/code/game/turfs/turf_changing.dm index e826867ab7..85292aa2b3 100644 --- a/code/game/turfs/turf_changing.dm +++ b/code/game/turfs/turf_changing.dm @@ -59,6 +59,7 @@ if(S.zone) S.zone.rebuild() cut_overlays(TRUE) + RemoveElement(/datum/element/turf_z_transparency) if(ispath(N, /turf/simulated/floor)) var/turf/simulated/W = new N( locate(src.x, src.y, src.z) ) diff --git a/code/modules/maps/tg/reader.dm b/code/modules/maps/tg/reader.dm index 542a0b9582..bb320e27ae 100644 --- a/code/modules/maps/tg/reader.dm +++ b/code/modules/maps/tg/reader.dm @@ -152,7 +152,7 @@ GLOBAL_DATUM_INIT(_preloader, /dmm_suite/preloader, new) if(xcrd > world.maxx) if(cropMap) break - else + else if(!measureOnly) world.maxx = xcrd if(xcrd >= 1) From 928cebf3cf7407aecb0c3c4e710b7c6e26851038 Mon Sep 17 00:00:00 2001 From: Leshana Date: Sun, 4 Jul 2021 16:40:50 -0400 Subject: [PATCH 5/8] Fix tag-matcher.py to work with python3 - Make robust to encoding errors in the files. - Fix indentation (tabs to spaces) - Fix syntax and iterator functions --- tools/TagMatcher/tag-matcher.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tools/TagMatcher/tag-matcher.py b/tools/TagMatcher/tag-matcher.py index ddbe9cbc20..9de9169845 100644 --- a/tools/TagMatcher/tag-matcher.py +++ b/tools/TagMatcher/tag-matcher.py @@ -20,14 +20,15 @@ THE SOFTWARE. import argparse, re, sys from collections import defaultdict from os import path, walk +from codecs import open opt = argparse.ArgumentParser() opt.add_argument('dir', help='The directory to scan for *.dm files with non-matching spans') args = opt.parse_args() if(not path.isdir(args.dir)): - print('Not a directory') - sys.exit(1) + print('Not a directory') + sys.exit(1) # These tuples are expected to be ordered as: # A unique human readable name (henceforth referred to as tuple name), a regex pattern matching an opening tag, a regex pattern matching a closing tag @@ -54,13 +55,13 @@ def get_tag_matches(line): # Support def that simply checks if a given dictionary in the format tag/list of unmatched lines has mismatch entries. def has_mismatch(match_list): - for tag, list_of_mismatched_lines in match_list.iteritems(): + for tag, list_of_mismatched_lines in match_list.items(): if(len(list_of_mismatched_lines) > 0): return 1 return 0 def arrange_mismatches(mismatches_by_tag, mismatch_line, mismatch_counts): - for tag, mismatch_count in mismatch_counts.iteritems(): + for tag, mismatch_count in mismatch_counts.items(): stack_of_existing_mismatches = mismatches_by_tag[tag] for i in range(0, abs(mismatch_count)): if len(stack_of_existing_mismatches) == 0: @@ -83,10 +84,10 @@ def arrange_mismatches(mismatches_by_tag, mismatch_line, mismatch_counts): # This section parses all *.dm files in the given directory, recursively. for root, subdirs, files in walk(args.dir): - for filename in files: - if filename.endswith('.dm'): - file_path = path.join(root, filename) - with open(file_path, 'r') as file: + for filename in files: + if filename.endswith('.dm'): + file_path = path.join(root, filename) + with open(file_path, 'r', encoding='utf-8', errors='ignore') as file: mismatches_by_file[file_path] = defaultdict(list) for line_number, line in enumerate(file, 1): # Then for each line in the file, conduct the tuple open/close matching. @@ -97,10 +98,10 @@ for root, subdirs, files in walk(args.dir): # Loops over all matches and checks if there is a mismatch of tags. # If so, then and only then is the corresponding file path printed along with the number of unmatched open/close tags. total_mismatches = 0 -for file, mismatches_by_tag in mismatches_by_file.iteritems(): +for file, mismatches_by_tag in mismatches_by_file.items(): if has_mismatch(mismatches_by_tag): print(file) - for tag, mismatch_list in mismatches_by_tag.iteritems(): + for tag, mismatch_list in mismatches_by_tag.items(): # A positive number means an excess of opening tag, a negative number means an excess of closing tags. total_mismatches += len(mismatch_list) if len(mismatch_list) > 0: From e0ec761fd7a7626bb157dd5f77f7f3c7be54e7d1 Mon Sep 17 00:00:00 2001 From: Leshana Date: Sun, 4 Jul 2021 16:08:57 -0400 Subject: [PATCH 6/8] Upgrade rust_g to version 0.4.0 Note - The linux binary depends on libssl.so.1.1 so make sure your environment is new enough to have that. --- .github/workflows/autochangelog.yml | 2 +- .github/workflows/ci.yml | 8 ++++---- .github/workflows/render_nanomaps.yml | 2 +- librust_g.so | Bin 7922548 -> 8484428 bytes rust_g.dll | Bin 5751808 -> 5532160 bytes 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/autochangelog.yml b/.github/workflows/autochangelog.yml index 7953929ce5..71a53a5b2d 100644 --- a/.github/workflows/autochangelog.yml +++ b/.github/workflows/autochangelog.yml @@ -11,7 +11,7 @@ env: jobs: autochangelog: name: Autochangelog - runs-on: ubuntu-16.04 + runs-on: ubuntu-20.04 if: github.event.pull_request.merged == true steps: - uses: /actions/checkout@v2 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33b71bb2aa..59319c4b8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ env: jobs: file_tests: name: Run Linters - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - name: Ensure +x on CI directory @@ -26,7 +26,7 @@ jobs: dreamchecker: name: DreamChecker - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 @@ -54,7 +54,7 @@ jobs: unit_tests: name: Integration Tests - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - name: Ensure +x on CI directory @@ -69,7 +69,7 @@ jobs: run: | sudo dpkg --add-architecture i386 sudo apt update || true - sudo apt install libc6:i386 libgcc1:i386 libstdc++6:i386 libssl1.0.0:i386 zlib1g:i386 + sudo apt install zlib1g-dev:i386 libssl-dev:i386 pkg-config:i386 ldd librust_g.so - name: Unit Tests run: | diff --git a/.github/workflows/render_nanomaps.yml b/.github/workflows/render_nanomaps.yml index f3a50a5e94..fd5536ea48 100644 --- a/.github/workflows/render_nanomaps.yml +++ b/.github/workflows/render_nanomaps.yml @@ -14,7 +14,7 @@ on: jobs: generate_maps: name: 'Generate NanoMaps' - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - name: Clone uses: actions/checkout@v2 diff --git a/librust_g.so b/librust_g.so index 9d46da045ff824f01d7a3d9de90a0e60a640a4c7..239f12d713efaee89c55cb3408a2757eb432275c 100644 GIT binary patch literal 8484428 zcmb5%e|&3eUJ&ZcnarFH(_!`;3e$lIxmd7bW^T`!3>J-AW-`!`4%C@|MRIBO?DU*$ zCVTI&cg{@D+$cqY7O2|Mhy?-!sTjP)Td``@2)!DmYK00>s|JbQaw*cQ6^a&al)F~) z?0xoGGxv|%!|Jo%AM1VJ@B6-Mtu&wg8NTKHOJDK2*S#+G_~-Sp*T+Vw!85URklA_g zt)rrJEE)TZ*lg@eV!v}-{`i8x_R%w=BOd16ijB)ppNYjBgVuXu;qiv2%Qxm@F~`Ag zy*(BlPha2vQ_Hdb_m7X}55GQ^`^&G7z0vhS%dysf{BW%Go8x0H7;t!m(6Z`V{cfPc-_Ka@eQwgeJjY1Z5&N}@+*JnJHyk*3llEqGr