Fixes for client network IDs

Fixed an off-by-one error on client IDs (these need to start at 1 as 0 is an invalid network ID). Morphing will now swap the client body's ID so it remains in the first 1 - MAXPLAYERS slots.
This commit is contained in:
Boondorl 2024-04-24 12:46:30 -04:00 committed by Ricardo Luís Vaz Silva
commit cf6bad97e8
3 changed files with 7 additions and 2 deletions

View file

@ -5390,6 +5390,10 @@ int MorphPointerSubstitution(AActor* from, AActor* to)
{
to->player = from->player;
from->player = nullptr;
// Swap the new body into the right network slot if it's a client (this doesn't
// really matter for regular Actors since they grab any ID they can get anyway).
NetworkEntityManager::SetClientNetworkEntity(to, to->player - players);
}
if (from->alternative != nullptr)