Exemplo n.º 1
0
qboolean PM_ClientImpact( trace_t *trace )
{
	//don't try to predict this
	gentity_t	*traceEnt;
	int			otherEntityNum = trace->entityNum;

	if ( !pm_entSelf )
	{
		return qfalse;
	}

	if ( otherEntityNum >= ENTITYNUM_WORLD )
	{
		return qfalse;
	}

	traceEnt = &g_entities[otherEntityNum];

	if( VectorLength( pm->ps->velocity ) >= 100 
		&& pm_entSelf->s.NPC_class != CLASS_VEHICLE
		&& pm->ps->lastOnGround+100 < level.time )
		//&& pm->ps->groundEntityNum == ENTITYNUM_NONE )
	{
		Client_CheckImpactBBrush( (gentity_t *)(pm_entSelf), &g_entities[otherEntityNum] );
	}

	if ( !traceEnt 
		|| !(traceEnt->r.contents&pm->tracemask) )
	{//it's dead or not in my way anymore, don't clip against it
		return qtrue;
	}

	return qfalse;
}
Exemplo n.º 2
0
qboolean PM_ClientImpact( trace_t *trace )
{
	//don't try to predict this
	gentity_t	*traceEnt;
	int			otherEntityNum = trace->entityNum;

	if ( !pm_entSelf )
	{
		return qfalse;
	}

	if ( otherEntityNum >= ENTITYNUM_WORLD )
	{
		if (pm->debugLevel){
			Com_Printf("PM_ClientImpact entity %i passes through entity %i (otherEntityNum(=%i) >= ENTITYNUM_WORLD)\n",
			pm->ps->clientNum,otherEntityNum,otherEntityNum);
		}
		return qfalse;
	}

	traceEnt = &g_entities[otherEntityNum];

	if( VectorLength( pm->ps->velocity ) >= 100 
		&& pm_entSelf->s.NPC_class != CLASS_VEHICLE
		&& pm->ps->lastOnGround+100 < level.time
		&& trace->fraction > 0.0F)
		//&& pm->ps->groundEntityNum == ENTITYNUM_NONE )
	{
		Client_CheckImpactBBrush( (gentity_t *)(pm_entSelf), &g_entities[otherEntityNum] );
	}

	if ( !traceEnt 
		|| !(traceEnt->r.contents&pm->tracemask) )
	{//it's dead or not in my way anymore, don't clip against it


		if (pm->debugLevel){
			if (!traceEnt)
				Com_Printf("PM_ClientImpact entity %i passes through entity %i (no traceEnt)\n",pm->ps->clientNum,otherEntityNum);
			else
				Com_Printf("PM_ClientImpact entity %i passes through entity %i (traceEnt->r.contents=%i pm->tracemask=%i)\n",
				pm->ps->clientNum,otherEntityNum,traceEnt->r.contents,pm->tracemask);
		}

		return qtrue;
	}

	return qfalse;
}