/*
==================
CG_ResetEntity
==================
*/
static void CG_ResetEntity( centity_t *cent ) {
	// if the previous snapshot this entity was updated in is at least
	// an event window back in time then we can reset the previous event
	if ( cent->snapShotTime < cg.time - EVENT_VALID_MSEC ) {
		cent->previousEvent = 0;
	}

	cent->trailTime = cg.snap->serverTime;

	VectorCopy (cent->currentState.origin, cent->lerpOrigin);
	VectorCopy (cent->currentState.angles, cent->lerpAngles);

	if (cent->currentState.eFlags & EF_G2ANIMATING)
	{ //reset the animation state
		cent->pe.torso.animationNumber = -1;
		cent->pe.legs.animationNumber = -1;
	}

#if 0
	if (cent->isRagging && (cent->currentState.eFlags & EF_DEAD))
	{
		VectorAdd(cent->lerpOrigin, cent->lerpOriginOffset, cent->lerpOrigin);
	}
#endif

	if ( cent->currentState.eType == ET_PLAYER || cent->currentState.eType == ET_NPC ) {
		CG_ResetPlayerEntity( cent );
	}
}
Exemplo n.º 2
0
/*
==================
CG_ResetEntity
==================
*/
static void CG_ResetEntity( centity_t *cent ) {
	// if an event is set, assume it is new enough to use
	// if the event had timed out, it would have been cleared
	// RF, not needed for wolf
	// DHM - Nerve :: Wolf is now using this.
	cent->previousEvent = 0;

	cent->trailTime = cg.snap->serverTime;

	// Ridah
	cent->headJuncIndex = 0;
	cent->headJuncIndex2 = 0;
	// RF, disabled this, since we clear events out now in g_main.c, this is redundant, and actually
	// causes "double-door-sound" syndrome if a door is triggered and heard, and then comes into view before
	// it has timed out in g_main.c, therefore playing the sound again, since it thinks it hasn't processed this
	// event yet.
	//cent->previousEventSequence = 0;
	// done.

	VectorCopy( cent->currentState.origin, cent->lerpOrigin );
	VectorCopy( cent->currentState.angles, cent->lerpAngles );
	if ( cent->currentState.eType == ET_PLAYER ) {
		CG_ResetPlayerEntity( cent );
	}
}
Exemplo n.º 3
0
/*
==================
CG_ResetEntity
==================
*/
static void CG_ResetEntity( centity_t *cent ) {
	lua_State *L = GetClientLuaState();
	qboolean isplayer = (&cgs.clientinfo[ cent->currentState.clientNum ] != NULL);
	if(L != NULL) {
		//cent->linked = qfalse;
		//qlua_gethook(L,"EntityUnlinked");
		//lua_pushentity(L,cent);
		//qlua_pcall(L,1,0,qtrue);

		if(cent->luatablecent != 0) { // && !isplayer
			qlua_clearfunc(L,cent->luatablecent);
			cent->luatablecent = 0;
		}
	} else {
		if(cent->luatablecent != 0) { // && !isplayer
			cent->luatablecent = 0;
		}
	}
	cent->customdraw = qfalse;

	// if the previous snapshot this entity was updated in is at least
	// an event window back in time then we can reset the previous event
	if ( cent->snapShotTime < cg.time - EVENT_VALID_MSEC || playBack ) {
		cent->previousEvent = 0;
	}

	cent->trailTime = cg.snap->serverTime;

	VectorCopy (cent->currentState.origin, cent->lerpOrigin);
	VectorCopy (cent->currentState.angles, cent->lerpAngles);
	if ( cent->currentState.eType == ET_PLAYER ) {
		CG_ResetPlayerEntity( cent );
	}
}
Exemplo n.º 4
0
/*
==================
CG_ResetEntity
==================
*/
static void CG_ResetEntity( centity_t *cent ) {
	VectorCopy (cent->currentState.origin, cent->lerpOrigin);
	VectorCopy (cent->currentState.angles, cent->lerpAngles);
	if ( cent->currentState.eType == ET_PLAYER ) {
		CG_ResetPlayerEntity( cent );
	}
}
Exemplo n.º 5
0
/*
==================
CG_ResetEntity
==================
*/
void CG_ResetEntity( centity_t *cent ) {
	// if an event is set, assume it is new enough to use
	// if the event had timed out, it would have been cleared
	cent->previousEvent = 0;

	cent->trailTime = cg.snap->serverTime;

	VectorCopy (cent->currentState.origin, cent->lerpOrigin);
	VectorCopy (cent->currentState.angles, cent->lerpAngles);
	if ( cent->currentState.eType == ET_PLAYER ) {
		CG_ResetPlayerEntity( cent );
	}
}
Exemplo n.º 6
0
/*
==================
CG_ResetEntity
==================
*/
static void CG_ResetEntity( centity_t *cent ) {
	// if the previous snapshot this entity was updated in is at least
	// an event window back in time then we can reset the previous event
	if ( cent->snapShotTime < cg.time - EVENT_VALID_MSEC ) {
		cent->previousEvent = 0;
	}

	cent->trailTime = cg.snap->serverTime;

	VectorCopy (cent->currentState.origin, cent->lerpOrigin);
	VectorCopy (cent->currentState.angles, cent->lerpAngles);
	if ( cent->currentState.eType == ET_PLAYER ) {
		CG_ResetPlayerEntity( cent );
	}
}
Exemplo n.º 7
0
/*
==================
CG_ResetEntity
==================
*/
static void CG_ResetEntity( centity_t *cent ) {
	// if an event is set, assume it is new enough to use
	// if the event had timed out, it would have been cleared
	// RF, not needed for wolf
	// DHM - Nerve :: Wolf is now using this.
	cent->previousEvent = 0;
	cent->previousEventSequence = cent->currentState.eventSequence;

	cent->trailTime = cg.snap->serverTime;

	// Ridah
	cent->headJuncIndex = 0;
	cent->headJuncIndex2 = 0;
	// done.

	VectorCopy (cent->currentState.origin, cent->lerpOrigin);
	VectorCopy (cent->currentState.angles, cent->lerpAngles);
	if ( cent->currentState.eType == ET_PLAYER ) {
		CG_ResetPlayerEntity( cent );
	}

	// rain - reset a bunch of extra stuff
	cent->muzzleFlashTime = 0;
	cent->overheatTime = 0;

	cent->miscTime = 0;
	cent->soundTime = 0;

	VectorClear(cent->rawOrigin);
	VectorClear(cent->rawAngles);
                
	cent->lastFuseSparkTime = 0;
	cent->highlightTime = 0;
	cent->highlighted = qfalse;
                
	cent->moving = qfalse;
	cent->akimboFire = qfalse;
}