Exemplo n.º 1
0
void flyer_kamikaze_check(edict_t *self)
{
	// PMM - this needed because we could have gone away before we get here (blocked code)
	if (!self->inuse)
		return;

	if (!self->enemy || !self->enemy->inuse || VectorCompare(self->s.old_origin, self->s.origin)) //mxd. Also explode when stuck...
	{
		flyer_kamikaze_explode(self);
		return;
	}

	self->goalentity = self->enemy;
	self->s.effects |= EF_ROCKET;
	VectorCopy(self->s.origin, self->s.old_origin); //mxd. Store old position...

	//mxd. Shrink bounding box to reduce the chance of getting STUK...
	if (self->maxs[0] != 8)
	{
		VectorSet(self->mins, -8, -8, -8);
		VectorSet(self->maxs, 8, 8, 8);
		gi.linkentity(self);
	}

	const float dist = realrange(self, self->enemy);
	if (dist < 90)
		flyer_kamikaze_explode(self);
	else if (dist < 128 || (level.framenum % 2 == 0)) //mxd. Play beep sound
		gi.sound(self, CHAN_VOICE, sound_suicide_beep, 1, ATTN_NORM, 0);
}
Exemplo n.º 2
0
void
flyer_kamikaze_check(edict_t *self)
{
	float dist;

	if (!self)
	{
		return;
	}

	/* this needed because we could have gone away before we get here (blocked code) */
	if (!self->inuse)
	{
		return;
	}

	if ((!self->enemy) || (!self->enemy->inuse))
	{
		flyer_kamikaze_explode(self);
		return;
	}

	self->goalentity = self->enemy;

	dist = realrange(self, self->enemy);

	if (dist < 90)
	{
		flyer_kamikaze_explode(self);
	}
}