Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#6267 closed defect (duplicate)

Discrepancy in the recognition of ai's json file

Reported by: zraktvor Owned by:
Priority: Should Have Milestone:
Component: AI Keywords:
Cc: Patch:

Description

Problem

GetAIsHelper::Run (in ICmpAIManager.cpp) and CAIPlayer::Initialise (in CCmpAIManager.cpp) disagree, how the json should be named. Because of GetAIsHelper::Run, every json file in the directory is interpreted as metadata for an AI. CAIPlayer::Initialise however requires it to be named "data.json".

This leads to a problem, if other .json files are in the directory. In my case, I have a tsconfig.json for Typescript-Configuration. I cannot use it for the metadata, because CAIPlayer::Initialise doesn't allow this, but if I make two files (data.json and tsconfig.json), GetAIsHelper::Run expects both files to be AIs.

Suggested Solution

CAIPlayer::Initialise already requires the name data.json. So GetAIsHelper::Run should only search for "data.json" to begin with.

Suggested Code Change

Old:

void GetAIsHelper::Run()

{

vfs::ForEachFile (g_VFS, L"simulation/ai/", Callback, (uintptr_t)this, L"*.json", vfs::DIR_RECURSIVE);

}

New:

void GetAIsHelper::Run()

{

vfs::ForEachFile (g_VFS, L"simulation/ai/", Callback, (uintptr_t)this, L"data.json", vfs::DIR_RECURSIVE);

}

Change History (3)

comment:1 by Silier, 3 years ago

Milestone: Alpha 26

comment:2 by Stan, 3 years ago

Resolution: duplicate
Status: newclosed

Dupe of #5899

comment:3 by Stan, 3 years ago

Milestone: Alpha 26
Note: See TracTickets for help on using tickets.