// Equivalent of BotDropToFloor for server entities void ServerEntityDropToFloor( g_serverEntity_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->origin[2] += 1.0; // fixes QErad -> engine bug? VectorSet( dest, ent->origin[0], ent->origin[1], ent->origin[2] - 4096 ); trap_Trace( &tr, ent->origin, checkMins, checkMaxs, dest, -1, MASK_PLAYERSOLID ); if ( tr.startsolid ) { // try raising us up some if (fabs(ent->origin[2] - ent->origin[2]) < 48) { ent->origin[2] += 4; ServerEntityDropToFloor( ent ); return; } G_Printf( "WARNING: %s (%s) in solid at %s\n", ent->classname, ent->name, vtos(ent->origin) ); return; } VectorCopy( tr.endpos, ent->origin ); }
// TAT 11/18/2002 - Use this function as the setup func for ai_markers that are NOT generated from q3map, but are parsed from the external file void SP_AIMarker_Setup(g_serverEntity_t *ent) { // since we didn't spawn, we haven't done this yet if (!(ent->spawnflags & 1)) { ServerEntityDropToFloor(ent); } }
// TAT 11/18/2002 - Use this function as the setup func for cover spots that are NOT generated from q3map, but are parsed from the external file void SP_SeekCover_Setup( g_serverEntity_t *ent ) { // since we didn't spawn, we haven't done this yet if ( !( ent->spawnflags & 1 ) ) { ServerEntityDropToFloor( ent ); } // now do the normal thing bot_seek_cover_spot_think( ent ); }