From 61e48e836ae4304c903a1bd7278f1526ea7b5595 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Wed, 30 Oct 2024 21:58:04 +0000 Subject: [PATCH] Remove string extractors expectation for traps name not to be copied --- lang/string_extractor/parsers/trap.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lang/string_extractor/parsers/trap.py b/lang/string_extractor/parsers/trap.py index 989f21af42724..62424d5186c93 100644 --- a/lang/string_extractor/parsers/trap.py +++ b/lang/string_extractor/parsers/trap.py @@ -2,25 +2,26 @@ def parse_trap(json, origin): - name = json["name"] - write_text(name, origin, comment="Name of a trap") + id = json["id"] + if "name" in json: + write_text(json["name"], origin, comment="Name of a trap") if "vehicle_data" in json and "sound" in json["vehicle_data"]: write_text(json["vehicle_data"]["sound"], origin, comment="Trap-vehicle collision message for trap '{}'" - .format(name)) + .format(id)) for key in ["memorial_male", "memorial_female"]: if key in json: write_text(json[key], origin, - comment="Memorial message of trap \"{}\"".format(name)) + comment="Memorial message of trap \"{}\"".format(id)) if "trigger_message_u" in json: write_text(json["trigger_message_u"], origin, comment="Message when player triggers trap \"{}\"" - .format(name)) + .format(id)) if "trigger_message_npc" in json: write_text(json["trigger_message_npc"], origin, comment="Message when NPC triggers trap \"{}\"" - .format(name)) + .format(id))