Fix issue with a player not being able to spawn when they join somone in co-op with a singleplayer team of more than the max allowed amount

This commit is contained in:
Melledy
2022-04-19 01:43:38 -07:00
parent 3cc025efe0
commit 7417a1b62c
3 changed files with 6 additions and 5 deletions

View File

@@ -95,14 +95,14 @@ public class MultiplayerManager {
hostPlayer.sendPacket(new PacketPlayerEnterSceneNotify(hostPlayer, hostPlayer, EnterType.EnterSelf, EnterReason.HostFromSingleToMp, hostPlayer.getScene().getId(), hostPlayer.getPos()));
}
// Make requester join
hostPlayer.getWorld().addPlayer(requester);
// Set scene pos and id of requester to the host player's
requester.getPos().set(hostPlayer.getPos());
requester.getRotation().set(hostPlayer.getRotation());
requester.setSceneId(hostPlayer.getSceneId());
// Make requester join
hostPlayer.getWorld().addPlayer(requester);
// Packet
requester.sendPacket(new PacketPlayerEnterSceneNotify(requester, hostPlayer, EnterType.EnterOther, EnterReason.TeamJoin, hostPlayer.getScene().getId(), hostPlayer.getPos()));
}