.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   Detecting new round (bug?).. (http://forums.bots-united.com/showthread.php?t=81)

stefanhendriks 29-12-2003 21:33

Detecting new round (bug?)..
 
I was wondering if anything changed to round detection since the realbot metamod plugin does not detect rounds as it should. THe code remained the same, perhaps i missed something here:

Code:

edict_t* pfnFindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue)
{
        // Counter-Strike - New Round Started
        if (strcmp(pszValue,"info_map_parameters") == 0)
        {
        UTIL_ClientPrintAll( HUD_PRINTNOTIFY, "New round\n");
                // New round started.
                Game.SetNewRound(true);
        Game.SetRoundTime(gpGlobals->time);               
        }

  RETURN_META_VALUE (MRES_IGNORED, NULL);
}

note, i added the util_clientprintall to see at console if anything happens.

I saw as well in CS 1.6 as in CS 1.5 the round-detection failed. In my version without metamod this worked okay. Perhaps the info_map_paramaters are initialized by metamod itself or whatever?

Gtg now, i hope someone has a quick answer ;)

Pierre-Marie Baty 29-12-2003 23:18

Re: Detecting new round (bug?)..
 
Well, as I see in the email you sent me, you figured out the problem yourself :)

I just forgot to reference pfnFindEntityByString() in the list of engine functions metamod should hook, that's why it was never called :)

Pierre-Marie Baty 29-12-2003 23:39

Re: Detecting new round (bug?)..
 
Stefan, you gotta add one function to the metamod GetEngineFunctions... I also forgot to add pfnRemoveEntity :)

The complete list should be :
Code:

C_DLLEXPORT int GetEngineFunctions (enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion)
{
  meta_engfuncs.pfnChangeLevel = pfnChangeLevel;
  meta_engfuncs.pfnFindEntityByString = pfnFindEntityByString;
  meta_engfuncs.pfnRemoveEntity = pfnRemoveEntity;
  meta_engfuncs.pfnClientCommand = pfnClientCommand;
  meta_engfuncs.pfnMessageBegin = pfnMessageBegin;
  meta_engfuncs.pfnMessageEnd = pfnMessageEnd;
  meta_engfuncs.pfnWriteByte = pfnWriteByte;
  meta_engfuncs.pfnWriteChar = pfnWriteChar;
  meta_engfuncs.pfnWriteShort = pfnWriteShort;
  meta_engfuncs.pfnWriteLong = pfnWriteLong;
  meta_engfuncs.pfnWriteAngle = pfnWriteAngle;
  meta_engfuncs.pfnWriteCoord = pfnWriteCoord;
  meta_engfuncs.pfnWriteString = pfnWriteString;
  meta_engfuncs.pfnWriteEntity = pfnWriteEntity;
  meta_engfuncs.pfnClientPrintf = pfnClientPrintf;
  meta_engfuncs.pfnCmd_Args = pfnCmd_Args;
  meta_engfuncs.pfnCmd_Argv = pfnCmd_Argv;
  meta_engfuncs.pfnCmd_Argc = pfnCmd_Argc;
  meta_engfuncs.pfnSetClientMaxspeed = pfnSetClientMaxspeed;
  meta_engfuncs.pfnGetPlayerUserId = pfnGetPlayerUserId;
  memcpy (pengfuncsFromEngine, &meta_engfuncs, sizeof (enginefuncs_t));
  return TRUE;
}


stefanhendriks 30-12-2003 16:36

Re: Detecting new round (bug?)..
 
thanks. I had work today so i did not look into this further yet. Applied the 'patch' now :)


All times are GMT +2. The time now is 14:55.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.