Fixed miscelaneous getLocation() issues and optimized some calls to avoid unnecessary copies

This commit is contained in:
Obique PSWG
2015-08-08 12:04:54 -05:00
parent 69c71e7e47
commit 68833935a5
6 changed files with 14 additions and 13 deletions
+4 -4
View File
@@ -199,7 +199,7 @@ public class PlayerManager extends Manager {
synchronized(players) {
for (Player p : players.values()) {
if (p != null && p.getCreatureObject() != null && p.getCreatureObject().getLocation().getTerrain() == terrain && conditional.meetsCondition(p))
if (p != null && p.getCreatureObject() != null && p.getCreatureObject().getTerrain() == terrain && conditional.meetsCondition(p))
p.sendPacket(packets);
}
}
@@ -208,7 +208,7 @@ public class PlayerManager extends Manager {
public void notifyPlayersAtPlanet(Terrain terrain, Packet... packets) {
synchronized(players) {
for (Player p : players.values()) {
if (p != null && p.getCreatureObject() != null && p.getCreatureObject().getLocation().getTerrain() == terrain)
if (p != null && p.getCreatureObject() != null && p.getCreatureObject().getTerrain() == terrain)
p.sendPacket(packets);
}
}
@@ -223,7 +223,7 @@ public class PlayerManager extends Manager {
synchronized(players) {
networkIds.forEach(id -> {
Player p = players.get(id);
if (p != null && p.getCreatureObject() != null && p.getCreatureObject().getLocation().getTerrain() == terrain && conditional.meetsCondition(p))
if (p != null && p.getCreatureObject() != null && p.getCreatureObject().getTerrain() == terrain && conditional.meetsCondition(p))
p.sendPacket(packets);
});
}
@@ -233,7 +233,7 @@ public class PlayerManager extends Manager {
synchronized(players) {
networkIds.forEach(id -> {
Player p = players.get(id);
if (p != null && p.getCreatureObject() != null && p.getCreatureObject().getLocation().getTerrain() == terrain)
if (p != null && p.getCreatureObject() != null && p.getCreatureObject().getTerrain() == terrain)
p.sendPacket(packets);
});
}