Commit b505b082 authored by Melledy's avatar Melledy
Browse files

Fix host team size not changing when a player joins their world for the first time

parent 62e54010
......@@ -148,7 +148,7 @@ public class World implements Iterable<Player> {
player.setPeerId(this.getNextPeerId());
player.getTeamManager().setEntityId(getNextEntityId(EntityIdType.TEAM));
// Copy main team to mp team
// Copy main team to multiplayer team
if (this.isMultiplayer()) {
player.getTeamManager().getMpTeam().copyFrom(player.getTeamManager().getCurrentSinglePlayerTeamInfo(), player.getTeamManager().getMaxTeamSize());
player.getTeamManager().setCurrentCharacterIndex(0);
......@@ -282,8 +282,8 @@ public class World implements Iterable<Player> {
private void updatePlayerInfos(Player paramPlayer) {
for (Player player : getPlayers()) {
// Dont send packets if player is loading in and filter out joining player
if (!player.hasSentAvatarDataNotify() || player.getSceneLoadState().getValue() < SceneLoadState.INIT.getValue() || player == paramPlayer) {
// Dont send packets if player is logging in and filter out joining player
if (!player.hasSentAvatarDataNotify() || player == paramPlayer) {
continue;
}
......@@ -293,6 +293,8 @@ public class World implements Iterable<Player> {
player.getTeamManager().updateTeamEntities(null);
}
// Dont send packets if player is loading into the scene
if (player.getSceneLoadState().getValue() < SceneLoadState.INIT.getValue() ) {
// World player info packets
player.getSession().send(new PacketWorldPlayerInfoNotify(this));
player.getSession().send(new PacketScenePlayerInfoNotify(this));
......@@ -303,6 +305,7 @@ public class World implements Iterable<Player> {
player.getSession().send(new PacketSyncScenePlayTeamEntityNotify(player));
}
}
}
public void broadcastPacket(BasePacket packet) {
// Send to all players - might have to check if player has been sent data packets
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment