.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   Hi I'm new and have some question ! (http://forums.bots-united.com/showthread.php?t=1047)

Pierre-Marie Baty 11-03-2004 14:14

Re: Hi I'm new and have some question !
 
Hey, my bad, my fault ! I forgotten one line:
the correct code for FREE_PRIVATE() is this one
Code:

  if (pEdict->pvPrivateData != NULL)
          FREE_PRIVATE (pEdict); // free our predecessor's private data
  pEdict->pvPrivateData = NULL; // fools the private data pointer
  pEdict->v.frags = 0; // reset his frag count

the last line is needed because the player's frags are stored outside of the private data. Freeing the private data resets the death count and any other statistic, but you also need to reset the frags count which is the only player statistics held in the entvars.

Terran 11-03-2004 15:06

Re: Hi I'm new and have some question !
 
STRIKE ! :D

It works now as expected. Even the deaths are cleared...

PBlover 11-03-2004 15:46

Re: Hi I'm new and have some question !
 
lol , I will change myself , plz don't thread me like that .. I am still learning ...

koraX 11-03-2004 18:56

Re: Hi I'm new and have some question !
 
don't post too much into this thread guys, thread will be deleted if he is banned. That's what happened to all my valuable 9_9 posts on 3colors's threads and there goes my postcount :(

(and this time I recommend an IP range instead of single IP :| )

cruft 15-03-2004 08:11

Re: Hi I'm new and have some question !
 
Quote:

Originally Posted by Pierre-Marie Baty
I think if the guy who did the JoeBot port for metamod missed this out then there must be plenty of things missing as well. If there's indeed a compile-time option for metamod then the correct code will look like this:

Code:

#ifdef METAMOD
CALL_GAME_ENTITY (PLID, "player", &pBotEdict->v);
#else
player (&pBotEdict->v);
#endif

I'm sure there are other problems like this one.

Well, it kinda looks like that but it's more like:

Code:

#ifndef USE_METAMOD
#define CALL_GAME_ENTITY(plid, entStr, pev) UTIL_CallGameEntity(entStr, pev)
#endif /* USE_METAMOD */

plid is ignored when compiling a standard dll. The code at sourceforge compiles both a metamod and standard dll based on the USE_METAMOD define. The entire codebase is free to look at in context at sourceforge which will make more sense then posted code snippets.


All times are GMT +2. The time now is 18:10.

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