View Single Post
Re: Turn off Bots shooting back after Teamattack
Old
  (#28)
KWo
Developer of PODBot mm
 
KWo's Avatar
 
Status: Offline
Posts: 3,425
Join Date: Apr 2004
Default Re: Turn off Bots shooting back after Teamattack - 06-06-2018

About team revenge - find in the file botcombat.cpp the function called FireHurtsFriend and find there following lines:
PHP Code:
   if (!FNullEnt (tr.pHit))
   {
      
ENTINDEX (tr.pHit) - 1;
      if ((
>= 0) && (gpGlobals->maxClients))  // KWo - 13.03.2006
      
{
         if ((
clients[i].iTeam == pBot->bot_team) && (pEdict->v.dmg_inflictor != clients[i].pEdict)
            && ((
clients[i].iFlags CLIENT_ALIVE) || (clients[i].fDeathTime >= gpGlobals->time)))  // KWo - 18.01.2011
         
{
            if (
g_b_DebugCombat)
               
ALERT (at_logged,"[DEBUG] FireHurtsFriend - Bot %s cannot fire because it may hurt its friend %s (1).\n"pBot->nameSTRING (clients[i].pEdict->v.netname));

            return (
TRUE);
         }
      }
   } 
and change the part:
PHP Code:
(pEdict->v.dmg_inflictor != clients[i].pEdict
this way:
PHP Code:
((pEdict->v.dmg_inflictor != clients[i].pEdict) || 
  (
pEdict->v.dmgtime 1.5 <= gpGlobals->time)) 
That should at least reduce the time for team revenges to maximum 1.5 sec from the time the bot got hurt by its friend. If that will not be enough satisfying - reduce the time to 1s. I would not reccommend to remove at all the team revenge function. Adding the cvar to on/off the team revenge function is more complicated and I don't have time to elaborate it.</div>

About that segmentation fault - compile the *.so file with debug flag enabled (in my makefile there was a way how to make the debuged version). Then it should write more details in gdb to let You narrow down the problem with the crash.
  
Reply With Quote