This should fix the problem where bots can't hit players using weapons other than the knife.

This commit is contained in:
Johnny Bergström 2005-08-07 13:38:34 +00:00
parent 7144f5c794
commit aa75a143fc
2 changed files with 6 additions and 2 deletions

View File

@ -61,6 +61,7 @@
// ######## Utils: // ######## Utils:
void FUNUTIL_ResetPlayer(int index) void FUNUTIL_ResetPlayer(int index)
{ {
//MF_PrintSrvConsole("Resetting player index %d! maxclients: %d\n", index, gpGlobals->maxClients);
for (int i = 1; i <= gpGlobals->maxClients; i++) { for (int i = 1; i <= gpGlobals->maxClients; i++) {
g_bodyhits[index][i] = (1<<HITGROUP_GENERIC) | g_bodyhits[index][i] = (1<<HITGROUP_GENERIC) |
(1<<HITGROUP_HEAD) | (1<<HITGROUP_HEAD) |
@ -654,14 +655,17 @@ void TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *shoot
void OnAmxxAttach() void OnAmxxAttach()
{ {
MF_AddNatives(fun_Exports); MF_AddNatives(fun_Exports);
}
// The content of OnPluginsLoaded() was moved from OnAmxxAttach with AMXx 1.5 because for some reason gpGlobals->maxClients wasn't
// initialized to its proper value until some time after OnAmxxAttach(). In OnAmxxAttach() it always showed 0. /JGHG
void OnPluginsLoaded() {
// Reset stuff - hopefully this should // Reset stuff - hopefully this should
for (int i = 1; i <= gpGlobals->maxClients; i++) { for (int i = 1; i <= gpGlobals->maxClients; i++) {
// Reset all hitzones // Reset all hitzones
FUNUTIL_ResetPlayer(i); FUNUTIL_ResetPlayer(i);
} }
} }
/* /*
void ClientConnectFakeBot(int index) void ClientConnectFakeBot(int index)
{ {

View File

@ -32,7 +32,7 @@
//#define FN_AMXX_DETTACH OnAmxxDettach //#define FN_AMXX_DETTACH OnAmxxDettach
// All plugins loaded // All plugins loaded
// Do forward functions init here (MF_RegisterForward) // Do forward functions init here (MF_RegisterForward)
// #define FN_AMXX_PLUGINSLOADED OnPluginsLoaded #define FN_AMXX_PLUGINSLOADED OnPluginsLoaded
/**** METAMOD ****/ /**** METAMOD ****/
// If your module doesn't use metamod, you may close the file now :) // If your module doesn't use metamod, you may close the file now :)