Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Don't init the m00 dict too early #183

Merged
merged 1 commit into from
Mar 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions app/hooking/network_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ def __init__(self, text_address, var_address):
self.text_address = NetworkTextTranslate.writer.unpack_to_int(text_address)
self.var_address = NetworkTextTranslate.writer.unpack_to_int(var_address)

if NetworkTextTranslate.m00_text is None:
NetworkTextTranslate.m00_text = generate_m00_dict()

var_name = self.var_address + 40

try:
Expand All @@ -59,6 +56,12 @@ def __init__(self, text_address, var_address):
category = ""
text = ""

# when we are on the login screen, this hook hits too soon. we don't want to
# prematurely init the dict as the database hasn't replace our placehold tags
# with player names. we see _MVER1, _MVER2, etc when we first log in.
if NetworkTextTranslate.m00_text is None and not category.startswith("_MVER"):
NetworkTextTranslate.m00_text = generate_m00_dict()

if category in NetworkTextTranslate.translate:
# "self" text when a player/monster uses a spell/skill on themselves
if category == "B_TARGET_RPL":
Expand Down