Skip to content

Commit

Permalink
fixed spectator frag issue
Browse files Browse the repository at this point in the history
Players don't wait for spectator packets.  I had it the other way around which meant spectators weren't waiting for player packets.  Oops!
  • Loading branch information
tra committed Jun 19, 2024
1 parent f80e867 commit d63b760
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/game/CPlayerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,8 @@ FunctionTable *CPlayerManagerImpl::GetFunctions() {
static int ASK_INTERVAL = MSEC_TO_TICK_COUNT(500);
static int WAITING_MESSAGE_COUNT = 4;

// don't wait for for players who are completely done (after limbo and spectating)
if (frameFuncs[i].validFrame != itsGame->frameNumber && theNetManager->IAmAlive()) {
// don't wait for for players who are completely done (after last life and after limbo)
if (frameFuncs[i].validFrame != itsGame->frameNumber && !IsDeadOrDone()) {
long firstTime = askAgainTime = TickCount();
long quickTick = firstTime;
long giveUpTime = firstTime + MSEC_TO_TICK_COUNT(15000);
Expand Down Expand Up @@ -1141,6 +1141,10 @@ void CPlayerManagerImpl::DeadOrDone() {
theNetManager->deadOrDonePlayers |= 1 << slot;
}

bool CPlayerManagerImpl::IsDeadOrDone() {
return (theNetManager->deadOrDonePlayers & (1 << slot));
}

short CPlayerManagerImpl::GetStatusChar() {
if (itsPlayer == NULL || (loadingStatus != kLActive && loadingStatus != kLPaused)) {
return -1;
Expand Down
2 changes: 2 additions & 0 deletions src/game/CPlayerManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class CPlayerManager {
virtual void GameKeyPress(char c) = 0;
virtual FunctionTable *GetFunctions() = 0;
virtual void DeadOrDone() = 0;
virtual bool IsDeadOrDone() = 0;
virtual short Position() = 0;
virtual Str255& PlayerName() = 0;
virtual std::string GetPlayerName() = 0;
Expand Down Expand Up @@ -257,6 +258,7 @@ class CPlayerManagerImpl : public CDirectObject, public CPlayerManager, public s
virtual void RemoveFromGame();

virtual void DeadOrDone();
virtual bool IsDeadOrDone();

virtual short GetStatusChar();
virtual short GetMessageIndicator();
Expand Down

0 comments on commit d63b760

Please sign in to comment.