Beispiel #1
0
/*
===============
BotDropToFloor
===============
*/
void BotDropToFloor( gentity_t *ent ) {
	vec3_t dest;
	trace_t tr;
	vec3_t checkMins, checkMaxs;

	//----(SA)	move the bounding box for the check in 1 unit on each side so they can butt up against a wall and not startsolid
	VectorCopy( playerMins, checkMins );
	checkMins[0] += 1;
	checkMins[1] += 1;
	VectorCopy( playerMaxs, checkMaxs );
	checkMaxs[0] -= 1;
	checkMaxs[1] -= 1;

	// use low max Z in case this is a crouch spot
	checkMaxs[2] = 0;

	// drop to floor
	ent->r.currentOrigin[2] += 1.0; // fixes QErad -> engine bug?
	VectorSet( dest, ent->r.currentOrigin[0], ent->r.currentOrigin[1], ent->r.currentOrigin[2] - 4096 );
	trap_Trace( &tr, ent->r.currentOrigin, checkMins, checkMaxs, dest, ent->s.number, MASK_PLAYERSOLID );

	if ( tr.startsolid ) {
		// try raising us up some
		if ( fabs( ent->r.currentOrigin[2] - ent->s.origin[2] ) < 48 ) {
			ent->r.currentOrigin[2] += 4;
			BotDropToFloor( ent );
			return;
		}
		G_Printf( "WARNING: %s (%s) in solid at %s\n", ent->classname, ent->targetname, vtos( ent->r.currentOrigin ) );
		return;
	}

	G_SetOrigin( ent, tr.endpos );
	VectorCopy( ent->r.currentOrigin, ent->s.origin );
}
Beispiel #2
0
void SP_Seek_Cover_Spawn(gentity_t * ent, int team)
{
	g_serverEntity_t *svEnt;

	if(!(ent->spawnflags & 1))
	{
		BotDropToFloor(ent);
	}

	ent->aiTeam = team;

// XreaL BEGIN
	// Doom 3 mapping convention: every entity has a name
	if(ent->targetname && !ent->targetnameAutogenerated)
	{
		// TAT 11/13/2002 - seek cover spots are special server only entities
		//      so let's make one with our data
		svEnt = CreateServerEntity(ent);
		//      set the setup func
		svEnt->setup = bot_seek_cover_spot_think;
	}
// XreaL END

	// free this entity - we should now have a server entity for it
	G_FreeEntity(ent);
}
Beispiel #3
0
Datei: g_bot.c Projekt: GenaSG/ET
/*QUAKED bot_attractor (1 0.2 0) (-18 -18 -24) (18 18 48) NODROP
Bots will defend this general area when enabled as a goal

NODROP means dont drop it to the ground
*/
void SP_bot_attractor( gentity_t *ent ) {
	if (!(ent->spawnflags & 1)) {
		BotDropToFloor( ent );
	}

	ent->r.svFlags |= SVF_NOCLIENT;
	ent->s.eType = ET_ATTRACTOR_HINT;
}
Beispiel #4
0
/*QUAKED bot_sniper_spot (1 0.2 0) (-18 -18 -24) (18 18 48) NODROP CROUCHING
Bots will use this spot to snipe from

NODROP means dont drop it to the ground

  "aiTeam" team to use this spot, if 0, any team can use it 1 = AXIS, 2 = ALLIES
*/
void SP_bot_sniper_spot( gentity_t *ent ) {
	if ( !( ent->spawnflags & 1 ) ) {
		BotDropToFloor( ent );
	}

	ent->r.svFlags |= SVF_NOCLIENT;
	ent->s.eType = ET_SNIPER_HINT;
}
Beispiel #5
0
void SP_ai_marker( gentity_t *ent ) {
	if ( !( ent->spawnflags & 1 ) ) {
		BotDropToFloor( ent );
	}

	// TAT 11/13/2002 - use the server entities for this
	CreateServerEntity( ent );

	// free this entity - we should now have a server entity for it
	G_FreeEntity( ent );

}
Beispiel #6
0
Datei: g_bot.c Projekt: GenaSG/ET
void SP_bot_landminespot_spot( gentity_t* ent ) {
	// MUST have a target
	if( !ent->target || !*ent->target ) {
		G_FreeEntity( ent );
		return;
	}

	if (!(ent->spawnflags & 1)) {
		BotDropToFloor( ent );
	}

	ent->r.svFlags |= SVF_NOCLIENT;
	ent->s.eType = ET_LANDMINESPOT_HINT;

	ent->think = bot_landminespot_setup;
	ent->nextthink = level.time + FRAMETIME;
}