예제 #1
0
static void Think_SmokeAndFire (edict_t *self)
{
	if (self->time + self->count <= level.actualRound) {
		bool checkVis = self->type == ET_SMOKE;
		G_EventEdictPerish(G_VisToPM(self->particleLink->visflags), self->particleLink);
		G_FreeEdict(self->particleLink);
		G_FreeEdict(self);
		if (checkVis)
			G_CheckVis(NULL);
	}
}
예제 #2
0
파일: g_spawn.cpp 프로젝트: danninemx/ufoai
static void Think_SmokeAndFire (Edict* self)
{
	const int endRound = self->time + self->count;
	const int spawnIndex = (self->team + level.teamOfs) % MAX_TEAMS;
	const int currentIndex = (level.activeTeam + level.teamOfs) % MAX_TEAMS;
	if (endRound < level.actualRound || (endRound == level.actualRound && spawnIndex <= currentIndex)) {
		const bool checkVis = self->type == ET_SMOKE;
		G_EventEdictPerish(G_VisToPM(self->particleLink->visflags), *self->particleLink);
		G_FreeEdict(self->particleLink);
		G_FreeEdict(self);
		if (checkVis)
			G_CheckVis(nullptr);
	}
}
예제 #3
0
/**
 * @brief Send the appear or perish event to the affected clients
 * @param[in] playerMask These are the affected players or clients
 * In case of e.g. teamplay there can be more than one client affected - thus
 * this is a player mask
 * @param[in] appear Is this event about an appearing actor (or a perishing one)
 * @param[in] check The edict we are talking about (that appears or perishes)
 * @param[in] ent The edict that was responsible for letting the check edict appear
 * or perish. Might be @c NULL.
 * @sa CL_ActorAppear
 */
void G_AppearPerishEvent (playermask_t playerMask, bool appear, edict_t *check, const edict_t *ent)
{
	teammask_t teamMaskDiff;

	/* test for pointless player mask */
	if (!playerMask)
		return;

	teamMaskDiff = G_PMToVis(playerMask);
	G_VisFlagsSwap(check, teamMaskDiff);

	if (appear) {
		/* appear */
		switch (check->type) {
		case ET_ACTOR:
		case ET_ACTOR2x2:
			G_EventActorAppear(playerMask, check, ent);
			break;

		case ET_CAMERA:
			G_EventCameraAppear(playerMask, check);
			break;

		case ET_ITEM:
			G_EventEdictAppear(playerMask, check);
			G_SendInventory(playerMask, check);
			break;

		case ET_PARTICLE:
			G_EventEdictAppear(playerMask, check);
			G_EventSendParticle(playerMask, check);
			break;

		case ET_TRIGGER_RESCUE:
			G_EventAddBrushModel(playerMask, check);
			break;

		default:
			if (G_IsVisibleOnBattlefield(check))
				gi.Error("Missing edict type %i in G_AppearPerishEvent", check->type);
			break;
		}
	} else if (G_IsVisibleOnBattlefield(check)) {
		G_EventEdictPerish(playerMask, check);
	}
}
예제 #4
0
/**
 * @brief Send an event to all clients that are seeing the given edict, that it just has disappeared
 * @param ent The edict that disappeared
 */
void G_EventPerish (const Edict& ent)
{
	G_EventEdictPerish(G_VisToPM(ent.visflags), ent);
}
예제 #5
0
/**
 * @brief Send an event to all clients that are seeing the given edict, that it just has disappeared
 * @param ent The edict that disappeared
 */
void G_EventPerish (const edict_t* ent)
{
	G_EventEdictPerish(G_VisToPM(ent->visflags), ent);
}