Fix bugs in spectator mode and removed unused FPCNs

First fix - now togglespect lets to return automatically to previously
spectated player, after spectating him, switching to "fly spectate" mode
and again to spectating players.
Second fix - now player doesn't land and stuck outside of new map,
when during spectating somebody map changed.
FCPNs are removed, because currently they aren't used.
This commit is contained in:
aurhat
2014-06-20 22:13:18 +02:00
parent 0898dfa384
commit 5a88f9c323
2 changed files with 3 additions and 7 deletions
+2 -4
View File
@@ -398,7 +398,6 @@ void deathstate(playerent *pl)
damageblend(-1);
if(pl->team == TEAM_SPECT) spectatemode(SM_FLY);
else if(team_isspect(pl->team)) spectatemode(SM_FOLLOW1ST);
if(pl->spectatemode == SM_DEATHCAM) player1->followplayercn = FPCN_DEATHCAM;
}
else pl->resetinterp();
}
@@ -1134,6 +1133,7 @@ void startmap(const char *name, bool reset, bool norespawn) // called just aft
suicided = -1;
spawncycle = -1;
lasthit = 0;
player1->followplayercn = -1;
if(m_valid(gamemode) && !m_mp(gamemode)) respawnself();
else findplayerstart(player1);
if(good_map()==MAP_IS_BAD) conoutf(_("You cannot play in this map due to quality requisites. Please, report this incident."));
@@ -1724,13 +1724,11 @@ void spectatemode(int mode)
player1->resetinterp();
}
else entinmap(player1); // or drop 'em at a random place
player1->followplayercn = FPCN_FLY;
}
break;
}
case SM_OVERVIEW:
player1->followplayercn = FPCN_OVERVIEW;
break;
break;
default: break;
}
player1->spectatemode = mode;
+1 -3
View File
@@ -109,7 +109,6 @@ enum { ENT_PLAYER = 0, ENT_BOT, ENT_CAMERA, ENT_BOUNCE };
enum { CS_ALIVE = 0, CS_DEAD, CS_SPAWNING, CS_LAGGED, CS_EDITING, CS_SPECTATE };
enum { CR_DEFAULT = 0, CR_ADMIN };
enum { SM_NONE = 0, SM_DEATHCAM, SM_FOLLOW1ST, SM_FOLLOW3RD, SM_FOLLOW3RD_TRANSPARENT, SM_FLY, SM_OVERVIEW, SM_NUM };
enum { FPCN_VOID = -4, FPCN_DEATHCAM = -2, FPCN_FLY = -2, FPCN_OVERVIEW = -1 };
class worldobject
{
@@ -440,7 +439,7 @@ public:
bool ignored, muted;
playerent() : curskin(0), clientnum(-1), lastupdate(0), plag(0), ping(0), address(0), lifesequence(0), frags(0), flagscore(0), deaths(0), points(0), tks(0), lastpain(0), lastvoicecom(0), clientrole(CR_DEFAULT),
team(TEAM_SPECT), spectatemode(SM_NONE), followplayercn(FPCN_VOID), eardamagemillis(0), respawnoffset(0),
team(TEAM_SPECT), spectatemode(SM_NONE), eardamagemillis(0), respawnoffset(0),
prevweaponsel(NULL), weaponsel(NULL), nextweaponsel(NULL), primweap(NULL), nextprimweap(NULL), lastattackweapon(NULL),
smoothmillis(-1),
head(-1, -1, -1), ignored(false), muted(false)
@@ -493,7 +492,6 @@ public:
void resetspec()
{
spectatemode = SM_NONE;
followplayercn = FPCN_VOID;
}
void respawn()