lookAtTarget (cursor) intendedTarget (target)

Updated target's position in the baseline.

The two unknown longs were the lookAtTarget (thing you cursor is
hovering over), which I believe probably comes before the actual target.

This could improve radial menus if the order is right, and allow them to
work even if you don't have the object targetted.
This commit is contained in:
Treeku
2014-03-19 20:36:43 +00:00
parent 45426e576c
commit 9a100ee49f
4 changed files with 70 additions and 22 deletions
+25 -5
View File
@@ -437,7 +437,7 @@ public class SimulationService implements INetworkDispatch {
});
objControllerOpcodes.put(ObjControllerOpcodes.TARGET_UPDATE, new INetworkRemoteEvent() {
objControllerOpcodes.put(ObjControllerOpcodes.lookAtTarget, new INetworkRemoteEvent() {
@Override
public void handlePacket(IoSession session, IoBuffer data) throws Exception {
@@ -460,19 +460,39 @@ public class SimulationService implements INetworkDispatch {
TargetUpdate targetUpdate = new TargetUpdate();
targetUpdate.deserialize(data);
object.setTargetId(targetUpdate.getTargetId());
object.setLookAtTarget(targetUpdate.getTargetId());
}
});
objControllerOpcodes.put(ObjControllerOpcodes.HOVER_TARGET, new INetworkRemoteEvent() {
objControllerOpcodes.put(ObjControllerOpcodes.intendedTarget, new INetworkRemoteEvent() {
@Override
public void handlePacket(IoSession session, IoBuffer data) throws Exception {
data.order(ByteOrder.LITTLE_ENDIAN);
Client client = core.getClient(session);
if(client == null) {
System.out.println("NULL Client");
return;
}
if(client.getParent() == null) {
System.out.println("NULL Object");
return;
}
CreatureObject object = (CreatureObject) client.getParent();
TargetUpdate targetUpdate = new TargetUpdate();
targetUpdate.deserialize(data);
object.setIntendedTarget(targetUpdate.getTargetId());
}
});
}