fixed bot's don't shoot thru walls

added some knife-mode movement
some codestyle fixes
This commit is contained in:
jeefo 2016-01-14 23:32:38 +03:00
commit 04365ab202
5 changed files with 342 additions and 399 deletions

View file

@ -1105,31 +1105,14 @@ int ClientConnect (edict_t *ent, const char *name, const char *addr, char reject
if (strcmp (addr, "loopback") == 0)
g_hostEntity = ent; // save the edict of the listen server client...
bots.AdjustQuota (true, ent);
if (g_isMetamod)
RETURN_META_VALUE (MRES_IGNORED, 0);
return (*g_functionTable.pfnClientConnect) (ent, name, addr, rejectReason);
}
void ClientPutInServer (edict_t *ent)
{
// this function is called once a just connected client actually enters the game, after
// having downloaded and synchronized its resources with the of the server's. It's the
// perfect place to hook for client connecting, since a client can always try to connect
// passing the ClientConnect() step, and not be allowed by the server later (because of a
// latency timeout or whatever reason). We can here keep track of both bots and players
// counts on occurence, since bots connect the server just like the way normal client do,
// and their third party bot flag is already supposed to be set then. If it's a bot which
// is connecting, we also have to awake its brain(s) by reading them from the disk.
bots.AdjustQuota (true, ent);
if (g_isMetamod)
RETURN_META (MRES_IGNORED);
(*g_functionTable.pfnClientPutInServer) (ent);
}
void ClientDisconnect (edict_t *ent)
{
// this function is called whenever a client is VOLUNTARILY disconnected from the server,
@ -2783,7 +2766,7 @@ void pfnAlertMessage (ALERT_TYPE alertType, char *format, ...)
vsprintf (buffer, format, ap);
va_end (ap);
if (strstr (buffer, "_Defuse_") != NULL)
if ((g_mapType & MAP_DE) && g_bombPlanted && strstr (buffer, "_Defuse_") != NULL)
{
// notify all terrorists that CT is starting bomb defusing
for (int i = 0; i < GetMaxClients (); i++)
@ -2840,7 +2823,6 @@ export int GetEntityAPI2 (gamefuncs_t *functionTable, int *)
functionTable->pfnTouch = Touch;
functionTable->pfnClientConnect = ClientConnect;
functionTable->pfnClientDisconnect = ClientDisconnect;
functionTable->pfnClientPutInServer = ClientPutInServer;
functionTable->pfnClientUserInfoChanged = ClientUserInfoChanged;
functionTable->pfnClientCommand = ClientCommand;
functionTable->pfnServerActivate = ServerActivate;