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
@@ -107,13 +107,14 @@ public class WaypointObject extends IntangibleObject implements OutOfBandData {
@Override
public void decode(ByteBuffer data) {
data.getInt();
setLocation(data.getFloat(), data.getFloat(), data.getFloat());
Location loc = new Location(data.getFloat(), data.getFloat(), data.getFloat(), null);
cellId = Packet.getLong(data);
getLocation().setTerrain(Terrain.getTerrainFromCrc(data.getInt()));
loc.setTerrain(Terrain.getTerrainFromCrc(data.getInt()));
name = Packet.getUnicode(data);
Packet.getLong(data); // objectId
color = WaypointColor.valueOf(data.get());
active = Packet.getBoolean(data);
setLocation(loc);
}
@Override