Fix duplicate "... entered battle" messages
This commit is contained in:
parent
0a26eee53a
commit
967fed3164
1 changed files with 53 additions and 44 deletions
|
@ -191,6 +191,8 @@ public class Battle
|
|||
}
|
||||
}
|
||||
|
||||
if(isServer)
|
||||
{
|
||||
for(Combatant c : this.sideA.values())
|
||||
{
|
||||
if(c.entityInfo != null)
|
||||
|
@ -221,6 +223,7 @@ public class Battle
|
|||
sendMessageToAllPlayers(PacketBattleMessage.MessageType.ENTERED, c.entity.getEntityId(), 0, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lastInstant = System.nanoTime();
|
||||
state = State.DECISION;
|
||||
|
@ -299,6 +302,8 @@ public class Battle
|
|||
newCombatant.yaw = e.rotationYaw;
|
||||
newCombatant.pitch = e.rotationPitch;
|
||||
}
|
||||
if(isServer)
|
||||
{
|
||||
if(newCombatant.entityInfo != null)
|
||||
{
|
||||
sendMessageToAllPlayers(PacketBattleMessage.MessageType.ENTERED, newCombatant.entity.getEntityId(), 0, id, newCombatant.entityInfo.category);
|
||||
|
@ -311,6 +316,7 @@ public class Battle
|
|||
{
|
||||
sendMessageToAllPlayers(PacketBattleMessage.MessageType.ENTERED, newCombatant.entity.getEntityId(), 0, id);
|
||||
}
|
||||
}
|
||||
notifyPlayersBattleInfo();
|
||||
}
|
||||
|
||||
|
@ -352,6 +358,8 @@ public class Battle
|
|||
newCombatant.yaw = e.rotationYaw;
|
||||
newCombatant.pitch = e.rotationPitch;
|
||||
}
|
||||
if(isServer)
|
||||
{
|
||||
if(newCombatant.entityInfo != null)
|
||||
{
|
||||
sendMessageToAllPlayers(PacketBattleMessage.MessageType.ENTERED, newCombatant.entity.getEntityId(), 0, id, newCombatant.entityInfo.category);
|
||||
|
@ -364,6 +372,7 @@ public class Battle
|
|||
{
|
||||
sendMessageToAllPlayers(PacketBattleMessage.MessageType.ENTERED, newCombatant.entity.getEntityId(), 0, id);
|
||||
}
|
||||
}
|
||||
notifyPlayersBattleInfo();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue