diff options
Diffstat (limited to 'src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventHandler.java')
-rwxr-xr-x | src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventHandler.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventHandler.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventHandler.java index a8a626f..e24b79c 100755 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventHandler.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventHandler.java | |||
@@ -6,6 +6,7 @@ | |||
6 | package com.fourisland.fourpuzzle.gamestate.mapview.event; | 6 | package com.fourisland.fourpuzzle.gamestate.mapview.event; |
7 | 7 | ||
8 | import com.fourisland.fourpuzzle.PuzzleApplication; | 8 | import com.fourisland.fourpuzzle.PuzzleApplication; |
9 | import com.fourisland.fourpuzzle.gamestate.mapview.viewpoint.AutomaticViewpoint; | ||
9 | import com.fourisland.fourpuzzle.util.ResourceNotFoundException; | 10 | import com.fourisland.fourpuzzle.util.ResourceNotFoundException; |
10 | import java.util.concurrent.ExecutorService; | 11 | import java.util.concurrent.ExecutorService; |
11 | import java.util.concurrent.Executors; | 12 | import java.util.concurrent.Executors; |
@@ -51,6 +52,14 @@ public class EventHandler { | |||
51 | try | 52 | try |
52 | { | 53 | { |
53 | callback.run(); | 54 | callback.run(); |
55 | } catch (InterruptedException ex) { | ||
56 | /* Swallow the interrupt, as the interruption probably | ||
57 | * indicates that the event should be cancelled | ||
58 | * | ||
59 | * Also reset the viewpoint in case the viewpoint was | ||
60 | * fixed during the thread */ | ||
61 | |||
62 | SpecialEvent.mapView.setViewpoint(new AutomaticViewpoint(SpecialEvent.mapView.getCurrentMap())); | ||
54 | } catch (ResourceNotFoundException ex) | 63 | } catch (ResourceNotFoundException ex) |
55 | { | 64 | { |
56 | PuzzleApplication.INSTANCE.reportError(ex); | 65 | PuzzleApplication.INSTANCE.reportError(ex); |