Esempio n. 1
0
File: player.c Progetto: deurk/ktx
void PlayerDie()
{
	self->ca_alive = false;

	DropPowerups();

	if ( isCTF() )
	{
		if ( self->hook_out )
		{
			GrappleReset( self->hook );
			self->attack_finished = g_globalvars.time + 0.75;
			self->hook_out = true; // FIXME: for which reason this set to true?
		}

		DropRune();
		PlayerDropFlag( self, false );
	}

	TeamplayDeathEvent (self);
#ifdef BOT_SUPPORT
	BotPlayerDeathEvent (self);
#endif

	self->s.v.items -= ( int ) self->s.v.items & IT_INVISIBILITY;
	self->invisible_finished = 0;	// don't die as eyes
	self->invincible_finished = 0;
// so we have quad few milleseconds after death
//	self->super_damage_finished = 0; // moved to prethink, like in ktpro
	self->radsuit_finished = 0;

	self->s.v.modelindex = modelindex_player;	// don't use eyes

	DropBackpack();

	self->weaponmodel = "";
	if (vw_enabled)
		self->vw_index = 9;	// null vwep model

	SetVector( self->s.v.view_ofs, 0, 0, -8 );
	self->s.v.deadflag = DEAD_DYING;
	self->s.v.solid = SOLID_NOT;
	self->s.v.flags -= ( ( int ) ( self->s.v.flags ) ) & FL_ONGROUND;
	self->s.v.movetype = MOVETYPE_TOSS;
	if ( self->s.v.velocity[2] < 10 )
		self->s.v.velocity[2] = self->s.v.velocity[2] + g_random() * 300;

    if ( self->s.v.health < -40 || dtSQUISH == self->deathtype || dtSUICIDE == self->deathtype || isRA() || isCA() )
	{
		GibPlayer();

		// Yawnmode: respawn has the same delay (900ms) regardless of deathtype gib/normal
		// - Molgrum

		// Hoonymode: Also force some time, e.g. to prevent instant respawn after /kill which
		// can cause bug if kill telefrags an idle player (counts as two points...)
		// only ever happens in testing, but oh well --phil
		if ( k_yawnmode || isHoonyModeDuel() )
		{
			self->s.v.nextthink = g_globalvars.time + 0.9;
			self->think = ( func_t ) PlayerDead;
			return;
		}

		PlayerDead();
		return;
	}

    if( match_in_progress == 2 )
		DeathSound();

	self->s.v.angles[0] = 0;
	self->s.v.angles[2] = 0;


    // function part split and called here
	StartDie();
}
Esempio n. 2
0
void TossFlag()
{
	PlayerDropFlag ( self, true );
}