From 034e72dcede8cf9c10ea8ae9eeae28f7a08154ad Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Sun, 23 Oct 2011 21:02:55 +0000 Subject: [PATCH] Add a comment for the last revision --- src/game/player/client.c | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/src/game/player/client.c b/src/game/player/client.c index 2a9a3f89..2ab14630 100644 --- a/src/game/player/client.c +++ b/src/game/player/client.c @@ -1185,30 +1185,37 @@ SelectSpawnPoint(edict_t *ent, vec3_t origin, vec3_t angles) } } - index = ent->client - game.clients; - - while(counter < 3) + /* If we are in coop and we didn't find a coop + spawnpoint due to map bugs (not correctly + connected or the map was loaded via console + and thus no previously map is known to the + client) use one in 384 units radius. */ + if (coop->value) { - coopspot = G_Find(coopspot, FOFS(classname), "info_player_coop"); + index = ent->client - game.clients; - if (!coopspot) + while(counter < 3) { - break; - } + coopspot = G_Find(coopspot, FOFS(classname), "info_player_coop"); - VectorSubtract(coopspot->s.origin, spot->s.origin, d); - - if ((VectorLength(d) < 384)) - { - if (index == counter) + if (!coopspot) { - spot = coopspot; - gi.dprintf("gotscha!\n"); break; } - else + + VectorSubtract(coopspot->s.origin, spot->s.origin, d); + + if ((VectorLength(d) < 384)) { - counter++; + if (index == counter) + { + spot = coopspot; + break; + } + else + { + counter++; + } } } }