MCPcopy Create free account
hub / github.com/REGoth-project/REGoth / exportScriptEngine

Method exportScriptEngine

src/logic/ScriptEngine.cpp:471–490  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

469}
470
471void ScriptEngine::exportScriptEngine(json& j)
472{
473 auto& dat = m_pVM->getDATFile();
474
475 // Walk the symtable and find any non-const integer without any flags
476 // Just like the original!
477
478 json& symbols = j["globals"];
479
480 for (auto& sym : dat.getSymTable().symbols)
481 {
482 // Only flat integers
483 if (sym.properties.elemProps.flags == 0 && sym.properties.elemProps.type == Daedalus::EParType_Int)
484 {
485 // Write arrays in order
486 for (int32_t i : sym.intData)
487 symbols.push_back({sym.name, i});
488 }
489 }
490}
491
492void ScriptEngine::importScriptEngine(const json& j)
493{

Callers 2

switchToWorldMethod · 0.80
saveToSlotMethod · 0.80

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected