View Single Post
Re: Something about msecval
Old
  (#18)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Something about msecval - 15-01-2004

@ botmeister: each time a player switches to a new weapon, his run speed changes. The function that the MOD code calls in the engine to change the client's max speed is SetClientMaxSpeed(). So yes, grab the value that is passed, and use it for your bots ; i.e. do this:
Code:
void pfnSetClientMaxspeed (const edict_t *pEdict, float fNewMaxspeed)
{
   int client_index = ENTINDEX ((edict_t *) pEdict) - 1; // get client index
 
   // is this message for a bot ? if so, remember its max speed
   if (players[client_index].is_racc_bot)
	  players[client_index].Bot.BotMove.f_max_speed = fNewMaxspeed;
 
   (*g_engfuncs.pfnSetClientMaxspeed) (pEdict, fNewMaxspeed);
}
@ Strelok: it is *normal* that the msec code has some influence on the bot's speed, but your problem doesn't come from here, because the msec code is *correct*. You should not change it. Instead, check for the bot's max speed. There is a problem in CS 1.6 where the player's max speed isn't set at round start (max_speed is initially 0 because pfnSetClientMaxSpeed() isn't called at round start like in 1.5) but it becomes set only when players switch to a new weapon. It may explain why your bots don't move as long as they don't change weapons.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote