Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more frag fixes #412

Merged
merged 1 commit into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/game/CGlowActors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,14 @@ void CGlowActors::FrameAction() {
}
}

// both the server and client update the FRandSeed here, if they get out of sync
// all clients update their FRandSeed here, if they get out of sync
// then this number will be different and will be noticed in CNetManager::AutoLatencyControl
uint32_t locsum = location[0] + location[1] + location[2];
UpdateFRandSeed(locsum);
// SDL_Log("frameNumber = %u, FRandSeed = %10d, locsum = %8d, Actor = %s", gCurrentGame->frameNumber, (Fixed)FRandSeed, locsum, typeid(*this).name());
uint32_t locsum = 0;
if (maskBits & kSolidBit) {
// only add "solid" objects to the checksum because the location of
// non-solid objects (invisible/limbo/dead) isn't relevant and could cause frags
uint32_t locsum = location[0] + location[1] + location[2];
UpdateFRandSeed(locsum);
}
// SDL_Log("fn = %u, FRandSeed = %10d, locsum = %8d, Actor = %s", gCurrentGame->frameNumber, (Fixed)FRandSeed, locsum, typeid(*this).name());
}
4 changes: 3 additions & 1 deletion src/game/CPlayerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,9 @@ void CPlayerManagerImpl::AbortRequest() {

void CPlayerManagerImpl::RemoveFromGame() {
theNetManager->activePlayersDistribution &= ~(1 << slot);
theNetManager->itsCommManager->SendUrgentPacket(kdEveryone, kpRemoveMeFromGame, 0, 0, 0, 0, 0);
// let inactive players know (not sure if this is even necessary)
uint16_t dist = kdEveryone & ~theNetManager->activePlayersDistribution;
theNetManager->itsCommManager->SendPacket(dist, kpRemoveMeFromGame, 0, 0, 0, 0, 0);
}

void CPlayerManagerImpl::DeadOrDone() {
Expand Down
Loading