View Single Post
Re: code to get the illumination at any point on the map
Old
  (#15)
Immortal_BLG
Member
 
Status: Offline
Posts: 171
Join Date: Nov 2007
Location: Russian Federation
Default Re: code to get the illumination at any point on the map - 17-03-2012

Quote:
I've checked bots light_level and it was still 0. I was using PMTOOLS from the filebase.
pEntity->v.light_level = 0
I believe Your code is to make the light_level of bots alive, but - at least on the listenserver CS1.6 steam - it doesn't do the job. Or maybe I misunderstood the point of this code?
[EDIT]
Just checked - on the dedicated server bots light_level is also still 0.
[/EDIT]
Of course all that will be as you describe
Because you do not assign a value of illumination received after the call of "Light::R_LightPoint" to variable "bot->v.light_level"!!
To get everything working as it should you just have to after each function call "pfnRunPlayerMove" to add the code:
Code:
if (!pBot->bDead)
   pEdict->v.light_level = Light::R_LightPoint (pEdict->v.origin);
and that's all!!!

as a result the code should look like:
Code:
g_engfuncs.pfnRunPlayerMove (pEdict, vecMoveAngles, pBot->f_move_speed, pBot->f_sidemove_speed, 0, pEdict->v.button, 0, (unsigned char) i_msecval);	// KWo - 25.09.2006 - thanks to THE_STORM

if (!pBot->bDead)
   pEdict->v.light_level = Light::R_LightPoint (pEdict->v.origin);
Why after calling of function "pfnRunPlayerMove"?
Because this function resets back to zero value of bot light_level and we just restores it to normal....
  
Reply With Quote