Stop some plugins from failing/crashing.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5670 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
81617eaebc
commit
50c4e75c65
3 changed files with 14 additions and 7 deletions
|
@ -1788,7 +1788,7 @@ static bool World_Bullet_DoInit(void)
|
|||
if (!rbefuncs || !rbefuncs->RegisterPhysicsEngine)
|
||||
{
|
||||
rbefuncs = nullptr;
|
||||
Con_Printf("Bullet plugin failed: Engine doesn't support physics engine plugins.\n");
|
||||
Con_Printf("Bullet plugin failed: Engine is incompatible.\n");
|
||||
}
|
||||
else if (!rbefuncs->RegisterPhysicsEngine("Bullet", World_Bullet_Start))
|
||||
Con_Printf("Bullet plugin failed: Engine already has a physics plugin active.\n");
|
||||
|
@ -1803,7 +1803,8 @@ static bool World_Bullet_DoInit(void)
|
|||
extern "C" qboolean Plug_Init(void)
|
||||
{
|
||||
rbefuncs = (rbeplugfuncs_t*)plugfuncs->GetEngineInterface("RBE", sizeof(*rbefuncs));
|
||||
if (rbefuncs && rbefuncs->version < RBEPLUGFUNCS_VERSION)
|
||||
if (rbefuncs && ( rbefuncs->version < RBEPLUGFUNCS_VERSION ||
|
||||
rbefuncs->wedictsize != sizeof(wedict_t)))
|
||||
rbefuncs = nullptr;
|
||||
|
||||
plugfuncs->ExportFunction("Shutdown", (funcptr_t)World_Bullet_Shutdown);
|
||||
|
|
|
@ -904,7 +904,14 @@ qboolean Plug_Init(void)
|
|||
{
|
||||
jclient_needreadconfig = true;
|
||||
|
||||
if (plugfuncs->ExportFunction("Tick", JCL_Frame) &&
|
||||
confuncs = (plugsubconsolefuncs_t*)plugfuncs->GetEngineInterface(plugsubconsolefuncs_name, sizeof(*confuncs));
|
||||
drawfuncs = (plug2dfuncs_t*)plugfuncs->GetEngineInterface(plug2dfuncs_name, sizeof(*drawfuncs));
|
||||
netfuncs = (plugnetfuncs_t*)plugfuncs->GetEngineInterface(plugnetfuncs_name, sizeof(*netfuncs));
|
||||
filefuncs = (plugfsfuncs_t*)plugfuncs->GetEngineInterface(plugfsfuncs_name, sizeof(*filefuncs));
|
||||
clientfuncs = (plugclientfuncs_t*)plugfuncs->GetEngineInterface(plugclientfuncs_name, sizeof(*clientfuncs));
|
||||
|
||||
if (netfuncs && filefuncs &&
|
||||
plugfuncs->ExportFunction("Tick", JCL_Frame) &&
|
||||
plugfuncs->ExportFunction("Shutdown", JCL_Shutdown) &&
|
||||
plugfuncs->ExportFunction("ExecuteCommand", JCL_ExecuteCommand))
|
||||
{
|
||||
|
@ -912,9 +919,10 @@ qboolean Plug_Init(void)
|
|||
|
||||
plugfuncs->ExportFunction("UpdateVideo", JCL_UpdateVideo);
|
||||
plugfuncs->ExportFunction("ConsoleLink", JCL_ConsoleLink);
|
||||
if (drawfuncs)
|
||||
plugfuncs->ExportFunction("ConsoleLinkMouseOver", JCL_ConsoleLinkMouseOver);
|
||||
|
||||
if (!plugfuncs->ExportFunction("ConExecuteCommand", JCL_ConExecuteCommand))
|
||||
if (!confuncs || !plugfuncs->ExportFunction("ConExecuteCommand", JCL_ConExecuteCommand))
|
||||
{
|
||||
Con_Printf("XMPP plugin in single-console mode\n");
|
||||
Con_TrySubPrint = Fallback_ConPrint;
|
||||
|
|
|
@ -663,8 +663,6 @@ static int QDECL QI_ConExecuteCommand(qboolean isinsecure)
|
|||
static qboolean QI_ExecuteCommand(qboolean isinsecure)
|
||||
{
|
||||
char cmd[256];
|
||||
if (isinsecure)
|
||||
return false;
|
||||
cmdfuncs->Argv(0, cmd, sizeof(cmd));
|
||||
if (!strcmp(cmd, "qi") || !strcmp(cmd, "quaddicted"))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue