mirror of
https://github.com/rehlds/metamod-r.git
synced 2025-02-05 18:20:35 +03:00
27 lines
813 B
C++
27 lines
813 B
C++
#include "precompiled.h"
|
|
|
|
// Function to perform common code of LINK_ENTITY_TO_GAME, rather than
|
|
// duplicating the code in ~2000 expanded macros. Based on code from Jussi
|
|
// Kivilinna <kijuhe00@students.oamk.fi>.
|
|
void NOINLINE do_link_ent(ENTITY_FN* pfnEntity, int* missing, const char* entStr, entvars_t* pev)
|
|
{
|
|
if (*missing) {
|
|
META_DEBUG(9, "Skipping entity '%s'; was previously found missing", entStr);
|
|
return;
|
|
}
|
|
|
|
if (!*pfnEntity) {
|
|
META_DEBUG(9, "Looking up game entity '%s'", entStr);
|
|
*pfnEntity = (ENTITY_FN)g_GameDLL.sys_module.getsym(entStr);
|
|
}
|
|
|
|
if (!*pfnEntity) {
|
|
META_ERROR("Couldn't find game entity '%s' in game DLL '%s': %s", entStr, g_GameDLL.name, CSysModule::getloaderror());
|
|
*missing = 1;
|
|
return;
|
|
}
|
|
|
|
META_DEBUG(8, "Linking game entity '%s'", entStr);
|
|
(*pfnEntity)(pev);
|
|
}
|