MCPcopy Create free account
hub / github.com/Warzone2100/warzone2100 / loadPlayerScriptByBackend

Function loadPlayerScriptByBackend

src/qtscript.cpp:518–529  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

516}
517
518static wzapi::scripting_instance* loadPlayerScriptByBackend(const WzString& path, int player, int realDifficulty)
519{
520 // JS scripts:
521 switch (war_getJSBackend())
522 {
523 case JS_BACKEND::quickjs:
524 return createQuickJSScriptInstance(path, player, realDifficulty);
525 case JS_BACKEND::num_backends:
526 debug(LOG_ERROR, "Invalid js backend value"); // should not happen
527 }
528 return nullptr;
529}
530
531wzapi::scripting_instance* scripting_engine::loadPlayerScript(const WzString& path, int player, AIDifficulty difficulty)
532{

Callers 1

loadPlayerScriptMethod · 0.85

Calls 2

war_getJSBackendFunction · 0.85

Tested by

no test coverage detected