Fixed being unable to extract plugin messages to translate them, fixed AI bug with Natural Gift and no item, fixed bad code when checking a trainer's party for a mon with a given type

This commit is contained in:
Maruno17
2021-06-15 19:23:50 +01:00
parent 128a002324
commit c23f50e5a6
3 changed files with 22 additions and 6 deletions

View File

@@ -32,6 +32,19 @@ def pbSetTextMessages
scr=Zlib::Inflate.inflate(script[2])
pbAddRgssScriptTexts(texts,scr)
end
if safeExists?("Data/PluginScripts.rxdata")
plugin_scripts = load_data("Data/PluginScripts.rxdata")
for plugin in plugin_scripts
for script in plugin[2]
if Time.now.to_i - t >= 5
t = Time.now.to_i
Graphics.update
end
scr = Zlib::Inflate.inflate(script[1]).force_encoding(Encoding::UTF_8)
pbAddRgssScriptTexts(texts,scr)
end
end
end
# Must add messages because this code is used by both game system and Editor
MessageTypes.addMessagesAsHash(MessageTypes::ScriptTexts,texts)
commonevents = load_data("Data/CommonEvents.rxdata")
@@ -250,7 +263,8 @@ def pbGetText(infile)
raise _INTL("Section {1} has an odd number of entries (section was recognized as a hash because its first line is not a number)",name)
end
end
i=0;loop do break unless i<section.length
i=0
loop do break unless i<section.length
if itemlength==3
if !section[i][/^\d+$/]
raise _INTL("Expected a number in section {1}, got {2} instead",name,section[i])