Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HotFix for AI mod loader #2443

Merged
merged 1 commit into from Apr 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions lua/simInit.lua
Expand Up @@ -186,6 +186,9 @@ function SetupSession()
LOG('Loading script file: ', ScenarioInfo.script)
doscript(ScenarioInfo.script, ScenarioInfo.Env)

-- Preloads AI telplates from AI mods
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't this meant to say "templates"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops :)

AIModTemplatesPreloader()

ResetSyncTable()
end

Expand Down Expand Up @@ -335,3 +338,20 @@ end

Prefetcher:Update(DefaultPrefetchSet())

function AIModTemplatesPreloader()
local simMods = import('/lua/mods.lua').AllMods()
for Index, ModData in simMods do
ModAIFiles = DiskFindFiles(ModData.location..'/lua/AI/CustomAIs_v2', '*.lua')
if ModAIFiles[1] then
for k,file in DiskFindFiles(ModData.location..'/lua/AI/PlatoonTemplates', '*.lua') do
import(file)
end
for k,file in DiskFindFiles(ModData.location..'/lua/AI/AIBuilders', '*.lua') do
import(file)
end
for k,file in DiskFindFiles(ModData.location..'/lua/AI/AIBaseTemplates', '*.lua') do
import(file)
end
end
end
end