mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-04-01 07:51:21 +00:00
Fix coop startup points in case that the map was loaded via console
This commit is contained in:
parent
55f51eb680
commit
ef85571d07
1 changed files with 33 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue