mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-07-31 01:15:57 -04:00
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:
@@ -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());
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user