From 956a511ec5e7a61c187cc15e9839aff88b50102d Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Fri, 7 Apr 2023 12:43:24 +0100 Subject: [PATCH] Fixed some errors when converting code in old trainer events to new code --- .../021_Compiler/004_Compiler_MapsAndEvents.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb b/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb index c23c5eb22..f03ee0ec9 100644 --- a/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb +++ b/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb @@ -1012,13 +1012,13 @@ module Compiler list[index].parameters[1] = sprintf("WildBattle.start(#{pkmn1}, #{pkmn2})") old_indent = list[index].indent new_events = [] - if battle_params[3] && battle_params[5][/false/] + if battle_params[5] && battle_params[5][/false/] push_script(new_events, "setBattleRule(\"cannotRun\")", old_indent) end - if battle_params[4] && battle_params[6][/true/] + if battle_params[6] && battle_params[6][/true/] push_script(new_events, "setBattleRule(\"canLose\")", old_indent) end - if battle_params[2] && battle_params[4] != "1" + if battle_params[4] && battle_params[4] != "1" push_script(new_events, "setBattleRule(\"outcome\", #{battle_params[4]})", old_indent) end list[index, 0] = new_events if new_events.length > 0 @@ -1031,13 +1031,13 @@ module Compiler list[index].parameters[1] = sprintf("WildBattle.start(#{pkmn1}, #{pkmn2}, #{pkmn3})") old_indent = list[index].indent new_events = [] - if battle_params[3] && battle_params[7][/false/] + if battle_params[7] && battle_params[7][/false/] push_script(new_events, "setBattleRule(\"cannotRun\")", old_indent) end - if battle_params[4] && battle_params[8][/true/] + if battle_params[8] && battle_params[8][/true/] push_script(new_events, "setBattleRule(\"canLose\")", old_indent) end - if battle_params[2] && battle_params[6] != "1" + if battle_params[6] && battle_params[6] != "1" push_script(new_events, "setBattleRule(\"outcome\", #{battle_params[6]})", old_indent) end list[index, 0] = new_events if new_events.length > 0 @@ -1108,7 +1108,7 @@ module Compiler speech = battle_params[7].gsub(/^\s*_I\(\s*"\s*/, "").gsub(/\"\s*\)\s*$/, "") push_comment(new_events, "EndSpeech2: #{speech.strip}", old_indent) end - if battle_params[7] && !battle_params[7].empty? && battle_params[11] != "nil" + if battle_params[11] && !battle_params[11].empty? && battle_params[11] != "nil" speech = battle_params[11].gsub(/^\s*_I\(\s*"\s*/, "").gsub(/\"\s*\)\s*$/, "") push_comment(new_events, "EndSpeech3: #{speech.strip}", old_indent) end