diff --git a/src/game/player/client.c b/src/game/player/client.c index e32cc963..2a9a3f89 100644 --- a/src/game/player/client.c +++ b/src/game/player/client.c @@ -72,8 +72,7 @@ SP_FixCoopSpots(edict_t *self) if (VectorLength(d) < 384) { - if ((!self->targetname) || - (Q_stricmp(self->targetname, spot->targetname) != 0)) + if ((!self->targetname) || (Q_stricmp(self->targetname, spot->targetname) != 0)) { self->targetname = spot->targetname; } @@ -1131,6 +1130,10 @@ void SelectSpawnPoint(edict_t *ent, vec3_t origin, vec3_t angles) { edict_t *spot = NULL; + edict_t *coopspot = NULL; + int index; + int counter = 0; + vec3_t d; if (!ent) { @@ -1182,6 +1185,34 @@ SelectSpawnPoint(edict_t *ent, vec3_t origin, vec3_t angles) } } + index = ent->client - game.clients; + + while(counter < 3) + { + coopspot = G_Find(coopspot, FOFS(classname), "info_player_coop"); + + if (!coopspot) + { + break; + } + + VectorSubtract(coopspot->s.origin, spot->s.origin, d); + + if ((VectorLength(d) < 384)) + { + if (index == counter) + { + spot = coopspot; + gi.dprintf("gotscha!\n"); + break; + } + else + { + counter++; + } + } + } + VectorCopy(spot->s.origin, origin); origin[2] += 9; VectorCopy(spot->s.angles, angles);