Fix for linux and q3 bots
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1573 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
d464398fb5
commit
37cf586005
1 changed files with 14 additions and 2 deletions
|
@ -49,11 +49,19 @@
|
|||
|
||||
#elif defined(__linux__)
|
||||
|
||||
#include "dlopen.h"
|
||||
#include "dlfcn.h"
|
||||
botlib_export_t *FTE_GetBotLibAPI( int apiVersion, botlib_import_t *import )
|
||||
{
|
||||
botlib_export_t *(*QDECL pGetBotLibAPI)( int apiVersion, botlib_import_t *import );
|
||||
void *handle;
|
||||
dlopen();
|
||||
handle = dlopen("botlib.so", RTLD_LAZY);
|
||||
if (!handle)
|
||||
return NULL;
|
||||
|
||||
pGetBotLibAPI = dlsym(handle, "GetBotLibAPI");
|
||||
if (!pGetBotLibAPI)
|
||||
return NULL;
|
||||
return pGetBotLibAPI(apiVersion, import);
|
||||
}
|
||||
#else
|
||||
botlib_export_t *FTE_GetBotLibAPI(int version, int apiVersion, botlib_import_t *import)
|
||||
|
@ -1537,6 +1545,10 @@ Con_Printf("builtin %i is not implemented\n", fn);
|
|||
return botlib->aas.AAS_PointReachabilityAreaIndex(VM_POINTER(arg[0]));
|
||||
|
||||
case BOTLIB_PC_LOAD_SOURCE:
|
||||
if (!botlib)
|
||||
{
|
||||
SV_Error("Botlib is not installed (trap BOTLIB_PC_LOAD_SOURCE)\n");
|
||||
}
|
||||
return botlib->PC_LoadSourceHandle(VM_POINTER(arg[0]));
|
||||
case BOTLIB_PC_FREE_SOURCE:
|
||||
return botlib->PC_FreeSourceHandle(VM_LONG(arg[0]));
|
||||
|
|
Loading…
Reference in a new issue