Skip to content

Commit

Permalink
Merge pull request #42 from pmacalpine/draw_command_selection_bug
Browse files Browse the repository at this point in the history
Fixing select agent in drawing protocol where the second byte of the …
  • Loading branch information
Gama11 committed Jun 1, 2015
2 parents eebe3e1 + 9a26bf1 commit efe050e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/rv/comm/drawing/commands/Control.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package rv.comm.drawing.commands;

import java.nio.ByteBuffer;
import js.io.ByteUtil;
import rv.Viewer;
import rv.world.objects.Agent;

Expand All @@ -13,7 +14,17 @@ public class Control extends Command {
public Control(ByteBuffer buf, Viewer viewer) {
super();
this.viewer = viewer;
agent = Command.readAgent(buf, viewer.getWorldModel());

int type = ByteUtil.uValue(buf.get());

switch (type) {
case AGENT_SELECT:
agent = Command.readAgent(buf, viewer.getWorldModel());
break;
default:
System.err.println("Unknown control : " + type);
agent = null;
}
}

@Override
Expand Down

0 comments on commit efe050e

Please sign in to comment.