Possibly fix the hitzones problem.

This commit is contained in:
Johnny Bergström 2005-01-13 11:02:14 +00:00
parent 8e58484fc5
commit 9959ef52b3
2 changed files with 24 additions and 8 deletions

View File

@ -619,17 +619,31 @@ int ClientConnect(edict_t *pPlayer, const char *pszName, const char *pszAddress,
}
void TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr) {
if ( (pentToSkip->v.flags & (FL_CLIENT | FL_FAKECLIENT)) == false || pentToSkip->v.deadflag != DEAD_NO)
RETURN_META(MRES_IGNORED);
TRACE_LINE(v1, v2, fNoMonsters, pentToSkip, ptr); // pentToSkip gotta be the one that is shooting, so filter it
if ( (ptr->pHit->v.flags & (FL_CLIENT | FL_FAKECLIENT)) == false )
RETURN_META(MRES_SUPERCEDE);
int hitIndex = ENTINDEX(ptr->pHit);
if (hitIndex >= 1 && hitIndex <= gpGlobals->maxClients) {
if ( !(
g_zones_getHit[hitIndex] & (1 << ptr->iHitgroup) // can ptr->pHit get hit in ptr->iHitgroup at all?
&& g_zones_toHit[hitIndex] & (1 << ptr->iHitgroup) ) // can pentToSkip hit other people in that hit zone?
) {
ptr->flFraction = 1.0; // set to not hit anything (1.0 = shot doesn't hit anything)
}
//bool blocked = false;
int canTargetGetHit = g_zones_getHit[hitIndex] & (1 << ptr->iHitgroup);
int canShooterHitThere = g_zones_toHit[ENTINDEX(pentToSkip)] & (1 << ptr->iHitgroup);
if (!canTargetGetHit || !canShooterHitThere) {
ptr->flFraction = 1.0; // set to not hit anything (1.0 = shot doesn't hit anything)
//blocked = true;
}
/*
if (blocked) {
MF_PrintSrvConsole("%s was blocked from hitting %s: %d and %d\n", MF_GetPlayerName(ENTINDEX(pentToSkip)), MF_GetPlayerName(hitIndex), canTargetGetHit, canShooterHitThere);
}
else {
MF_PrintSrvConsole("%s was NOT blocked from hitting %s: %d and %d\n", MF_GetPlayerName(ENTINDEX(pentToSkip)), MF_GetPlayerName(hitIndex), canTargetGetHit, canShooterHitThere);
}
*/
RETURN_META(MRES_SUPERCEDE);
}

View File

@ -54,6 +54,8 @@
TargetEnvironment="1"
TypeLibraryName=".\Release/fun.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
@ -100,7 +102,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="Debug/fun_amxx_debug.dll"
OutputFile="Debug/fun_amxx.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ModuleDefinitionFile=""