mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Fixed some errors when converting code in old trainer events to new code
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user