Fix bug where game freezes in infinite loop because it doesn't find a spawn point on maps with many bot/human-only spawnpoints. Thanks Pan for reporting this

This commit is contained in:
Thilo Schulz 2009-11-03 13:28:52 +00:00
parent 018de1dd2e
commit f5d79ea066
6 changed files with 89 additions and 62 deletions

View file

@ -977,7 +977,7 @@ qboolean Team_GetLocationMsg(gentity_t *ent, char *loc, int loclen)
/*
================
SelectRandomDeathmatchSpawnPoint
SelectRandomTeamSpawnPoint
go to a random point that doesn't telefrag
================
@ -1033,13 +1033,13 @@ SelectCTFSpawnPoint
============
*/
gentity_t *SelectCTFSpawnPoint ( team_t team, int teamstate, vec3_t origin, vec3_t angles ) {
gentity_t *SelectCTFSpawnPoint ( team_t team, int teamstate, vec3_t origin, vec3_t angles, qboolean isbot ) {
gentity_t *spot;
spot = SelectRandomTeamSpawnPoint ( teamstate, team );
if (!spot) {
return SelectSpawnPoint( vec3_origin, origin, angles );
return SelectSpawnPoint( vec3_origin, origin, angles, isbot );
}
VectorCopy (spot->s.origin, origin);