Do not alter the existing info_player_start, create a new one instead

This commit is contained in:
Yamagi Burmeister 2011-10-24 10:08:02 +00:00
parent a01bcd5972
commit 184bbee145

View file

@ -134,33 +134,29 @@ SP_CreateCoopSpots(edict_t *self)
* normal gameplay, but if the map is loaded * normal gameplay, but if the map is loaded
* via console there is a huge chance that * via console there is a huge chance that
* the player will spawn in the wrong point. * the player will spawn in the wrong point.
* Therefor create an unnamed info_player_start * Therefore create an unnamed info_player_start
* at the correct point. * at the correct point.
*/ */
void void
SP_CreateUnnamedSpawn(edict_t *self) SP_CreateUnnamedSpawn(edict_t *self)
{ {
edict_t *spot; edict_t *spot = G_Spawn();
if (!self) if (!self)
{ {
return; return;
} }
/* If there is a spawnpoint to use, we
don't need any unnamed spawnpoints */
if (Q_stricmp(game.spawnpoint, "") != 0)
{
return;
}
/* mine1 */ /* mine1 */
if (Q_stricmp(level.mapname, "mine1") == 0) if (Q_stricmp(level.mapname, "mine1") == 0)
{ {
if (Q_stricmp(self->targetname, "mintro") == 0) if (Q_stricmp(self->targetname, "mintro") == 0)
{ {
spot = G_Spawn(); spot->classname = self->classname;
spot = self; spot->s.origin[0] = self->s.origin[0];
spot->s.origin[1] = self->s.origin[1];
spot->s.origin[2] = self->s.origin[2];
spot->s.angles[1] = self->s.angles[1];
spot->targetname = NULL; spot->targetname = NULL;
return; return;
@ -172,8 +168,11 @@ SP_CreateUnnamedSpawn(edict_t *self)
{ {
if (Q_stricmp(self->targetname, "mine1") == 0) if (Q_stricmp(self->targetname, "mine1") == 0)
{ {
spot = G_Spawn(); spot->classname = self->classname;
spot = self; spot->s.origin[0] = self->s.origin[0];
spot->s.origin[1] = self->s.origin[1];
spot->s.origin[2] = self->s.origin[2];
spot->s.angles[1] = self->s.angles[1];
spot->targetname = NULL; spot->targetname = NULL;
return; return;
@ -185,8 +184,11 @@ SP_CreateUnnamedSpawn(edict_t *self)
{ {
if (Q_stricmp(self->targetname, "mine2a") == 0) if (Q_stricmp(self->targetname, "mine2a") == 0)
{ {
spot = G_Spawn(); spot->classname = self->classname;
spot = self; spot->s.origin[0] = self->s.origin[0];
spot->s.origin[1] = self->s.origin[1];
spot->s.origin[2] = self->s.origin[2];
spot->s.angles[1] = self->s.angles[1];
spot->targetname = NULL; spot->targetname = NULL;
return; return;
@ -198,8 +200,11 @@ SP_CreateUnnamedSpawn(edict_t *self)
{ {
if (Q_stricmp(self->targetname, "mine3") == 0) if (Q_stricmp(self->targetname, "mine3") == 0)
{ {
spot = G_Spawn(); spot->classname = self->classname;
spot = self; spot->s.origin[0] = self->s.origin[0];
spot->s.origin[1] = self->s.origin[1];
spot->s.origin[2] = self->s.origin[2];
spot->s.angles[1] = self->s.angles[1];
spot->targetname = NULL; spot->targetname = NULL;
return; return;
@ -211,8 +216,11 @@ SP_CreateUnnamedSpawn(edict_t *self)
{ {
if (Q_stricmp(self->targetname, "power1") == 0) if (Q_stricmp(self->targetname, "power1") == 0)
{ {
spot = G_Spawn(); spot->classname = self->classname;
spot = self; spot->s.origin[0] = self->s.origin[0];
spot->s.origin[1] = self->s.origin[1];
spot->s.origin[2] = self->s.origin[2];
spot->s.angles[1] = self->s.angles[1];
spot->targetname = NULL; spot->targetname = NULL;
return; return;
@ -224,8 +232,11 @@ SP_CreateUnnamedSpawn(edict_t *self)
{ {
if (Q_stricmp(self->targetname, "power2") == 0) if (Q_stricmp(self->targetname, "power2") == 0)
{ {
spot = G_Spawn(); spot->classname = self->classname;
spot = self; spot->s.origin[0] = self->s.origin[0];
spot->s.origin[1] = self->s.origin[1];
spot->s.origin[2] = self->s.origin[2];
spot->s.angles[1] = self->s.angles[1];
spot->targetname = NULL; spot->targetname = NULL;
return; return;
@ -237,8 +248,11 @@ SP_CreateUnnamedSpawn(edict_t *self)
{ {
if (Q_stricmp(self->targetname, "waste1") == 0) if (Q_stricmp(self->targetname, "waste1") == 0)
{ {
spot = G_Spawn(); spot->classname = self->classname;
spot = self; spot->s.origin[0] = self->s.origin[0];
spot->s.origin[1] = self->s.origin[1];
spot->s.origin[2] = self->s.origin[2];
spot->s.angles[1] = self->s.angles[1];
spot->targetname = NULL; spot->targetname = NULL;
return; return;
@ -250,8 +264,11 @@ SP_CreateUnnamedSpawn(edict_t *self)
{ {
if (Q_stricmp(self->targetname, "waste2") == 0) if (Q_stricmp(self->targetname, "waste2") == 0)
{ {
spot = G_Spawn(); spot->classname = self->classname;
spot = self; spot->s.origin[0] = self->s.origin[0];
spot->s.origin[1] = self->s.origin[1];
spot->s.origin[2] = self->s.origin[2];
spot->s.angles[1] = self->s.angles[1];
spot->targetname = NULL; spot->targetname = NULL;
return; return;
@ -263,8 +280,11 @@ SP_CreateUnnamedSpawn(edict_t *self)
{ {
if (Q_stricmp(self->targetname, "city2NL") == 0) if (Q_stricmp(self->targetname, "city2NL") == 0)
{ {
spot = G_Spawn(); spot->classname = self->classname;
spot = self; spot->s.origin[0] = self->s.origin[0];
spot->s.origin[1] = self->s.origin[1];
spot->s.origin[2] = self->s.origin[2];
spot->s.angles[1] = self->s.angles[1];
spot->targetname = NULL; spot->targetname = NULL;
return; return;