From 3c9378c6a91c812d5d619faf8cd45f904d8a6b70 Mon Sep 17 00:00:00 2001 From: santichausis Date: Mon, 7 Sep 2026 23:03:58 -0300 Subject: [PATCH] Fix column indices when building MoveChange from move_changelog.csv move_changelog.csv columns are: move_id,changed_in_version_group_id,type_id,power,pp,accuracy,priority, target_id,effect_id,effect_chance The build script read info[6]/info[7] (priority/target_id, neither of which MoveChange models) as effect_id/effect_chance instead of the actual info[8]/info[9] columns. This dropped real effect changes (e.g. Double-Edge's recoil effect at gold-silver) and fabricated bogus ones from unrelated numeric values (e.g. Follow Me picked up a false "chance to poison" effect from its priority value of 3, which happens to be move_effect id 3). Fixes #1663 --- data/v2/build.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/v2/build.py b/data/v2/build.py index 07bab11ac..4103037fb 100644 --- a/data/v2/build.py +++ b/data/v2/build.py @@ -789,7 +789,7 @@ def csv_record_to_objects(info): existing_effect_ids = set(MoveEffect.objects.values_list("pk", flat=True)) def csv_record_to_objects(info): - effect_id = int(info[6]) if info[6] != "" else None + effect_id = int(info[8]) if info[8] != "" else None if effect_id not in existing_effect_ids: effect_id = None @@ -801,7 +801,7 @@ def csv_record_to_objects(info): pp=int(info[4]) if info[4] != "" else None, accuracy=int(info[5]) if info[5] != "" else None, move_effect_id=effect_id, - move_effect_chance=int(info[7]) if info[7] != "" else None, + move_effect_chance=int(info[9]) if info[9] != "" else None, ) build_generic((MoveChange,), "move_changelog.csv", csv_record_to_objects)