Create TLuaChunk constructor to satisfy MSVC

This commit is contained in:
Lion Kortlepel 2021-09-19 12:12:38 +02:00
parent 701e613990
commit 60b86e2be6
No known key found for this signature in database
GPG Key ID: 4322FF2B4C71259B
3 changed files with 10 additions and 1 deletions

View File

@ -45,6 +45,9 @@ struct TLuaPluginConfig {
};
struct TLuaChunk {
TLuaChunk(std::shared_ptr<std::string> Content,
std::string FileName,
std::string PluginPath);
std::shared_ptr<std::string> Content;
std::string FileName;
std::string PluginPath;

View File

@ -497,3 +497,9 @@ void TLuaResult::WaitUntilReady() {
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
}
TLuaChunk::TLuaChunk(std::shared_ptr<std::string> Content, std::string FileName, std::string PluginPath)
: Content(Content)
, FileName(FileName)
, PluginPath(PluginPath) {
}

View File

@ -40,7 +40,7 @@ TLuaPlugin::TLuaPlugin(TLuaEngine& Engine, const TLuaPluginConfig& Config, const
beammp_debug("Successfully read \"" + Entry.string() + "\" (" + std::to_string(NRead) + " Bytes)");
mFileContents[fs::relative(Entry).string()] = Contents;
// Execute first time
auto Result = mEngine.EnqueueScript(mConfig.StateId, TLuaChunk { Contents, Entry, MainFolder });
auto Result = mEngine.EnqueueScript(mConfig.StateId, TLuaChunk(Contents, Entry, MainFolder));
ResultsToCheck.emplace_back(Entry.string(), std::move(Result));
} else {
beammp_error("Error while reading script file \"" + Entry.string() + "\". Did the file change while reading?");