From 774f64f6199b4945134569495e4ed7f74f05dceb Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 19 Jan 2025 12:58:59 +0000 Subject: [PATCH] Add: Support more than 255 badgetable entries. --- nml/actions/action0.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/nml/actions/action0.py b/nml/actions/action0.py index 4db083a1..e55fd945 100644 --- a/nml/actions/action0.py +++ b/nml/actions/action0.py @@ -809,10 +809,21 @@ def get_cargolist_action(cargo_list): def get_badgelist_action(badge_list): - action0 = Action0(0x08, 0) - action0.prop_list.append(StringListProp(0x18, badge_list)) - action0.num_ids = len(badge_list) - return [action0] + index = 0 + actions = [] + while index < len(badge_list): + last = index + len(badge_list) + if last - index > 250: + last = index + 250 + + action0 = Action0(0x08, index) + action0.prop_list.append(StringListProp(0x18, badge_list[index:last])) + action0.num_ids = last - index + actions.append(action0) + + index = last + + return actions def get_tracktypelist_action(table_prop_id, cond_tracktype_not_defined, tracktype_list):