Commits

Anonymous committed 0f6aa40

limit waypoints to current world

  • Participants
  • Parent commits e486ff2

Comments (0)

Files changed (1)

File src/main/java/com/zzzcomputing/bukkit/ZeekTools/commands/WaypointCommand.java

                         public Waypoint invoke(Database.Handle handle) throws SQLException {
                             ResultSet result = handle.execQuery(
                                     "SELECT id, waypoint_name, x, y, z, world_uid FROM waypoint " +
-                                     "WHERE player_name=? AND waypoint_name=?", 
-                                    player.getName(), name);
+                                     "WHERE player_name=? AND waypoint_name=? AND world_uid=?", 
+                                    player.getName(), name, player.getWorld().getUID().toString());
                             if (result.next()) {
                                 return new Waypoint(player, result);
                             }
                             List<Waypoint> l = new ArrayList<Waypoint>();
                             ResultSet result = handle.execQuery(
                                     "SELECT id, waypoint_name, x, y, z, world_uid " +
-                                    "FROM waypoint WHERE player_name=?", 
-                                    player.getName());
+                                    "FROM waypoint WHERE player_name=? AND world_uid=?", 
+                                    player.getName(), player.getWorld().getUID().toString());
                             while (result.next()) {
                                 l.add(new Waypoint(player, result));
                             }