MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / TryCompile

Method TryCompile

core/logic/PluginSys.cpp:484–502  ·  view source on GitHub ↗

Only called during plugin construction.

Source from the content-addressed store, hash-verified

482
483// Only called during plugin construction.
484bool CPlugin::TryCompile()
485{
486 char fullpath[PLATFORM_MAX_PATH];
487 g_pSM->BuildPath(Path_SM, fullpath, sizeof(fullpath), "plugins/%s", m_filename);
488
489 char loadmsg[255];
490 m_pRuntime.reset(g_pPawnEnv->LoadBinaryFromFile(fullpath, loadmsg, sizeof(loadmsg)));
491 if (!m_pRuntime) {
492 EvictWithError(Plugin_BadLoad, "Unable to load plugin (%s)", loadmsg);
493 return false;
494 }
495
496 // ReadInfo() sets its own error state.
497 if (!ReadInfo())
498 return false;
499
500 m_status = Plugin_Created;
501 return true;
502}
503
504IPluginContext *CPlugin::GetBaseContext()
505{

Callers 1

CompileAndPrepMethod · 0.80

Calls 2

BuildPathMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected