We need to produce a unified diff fixing two files. Provide diff with context. Let's assume file paths: trading_game/game/app.py and trading_game/game/screens/world_map.py.

We need to set self.current_screen before using. In run loop, after processing events, maybe before event handling we set self.current_screen = self.screen_stack[-1] if stack not empty. Let's locate run method lines 173-211. We'll add assignment before event handling for mouse events.

Also fix world_map Cancel Travel button: create button once, maybe in __init__ or as attribute. We'll add attribute self.cancel_travel_btn initialized in __init__ or in some method. Simpler: check if not hasattr(self, 'cancel_travel_btn'): create it. Then use self.cancel_travel_btn.handle_event(event). Also ensure event param is passed.

Let's produce diff.

--- a/trading_game/game/app.py
+++ b/trading_game/game/app.py
@@
-        while running:
-            for event in pygame.event.get():
-                if event.type == pygame.QUIT:
-                    running = False
-                elif event.type in (pygame.MOUSEMOTION, pygame.MOUSEBUTTONDOWN, pygame.MOUSEBUTTONUP):
-                    if self.current_screen and hasattr(self.current_screen, 'handle_event'):
-                        if self.current_screen.handle_event(event):
-                            running = False
+        while running:
+            # Ensure we always have a reference to the active screen before handling events
+            if self.screen_stack:
+                self.current_screen = self.screen_stack[-1]
+            else:
+                self.current_screen = None
+
+            for event in pygame.event.get():
+                if event.type == pygame.QUIT:
+                    running = False
+                elif event.type in (pygame.MOUSEMOTION, pygame.MOUSEBUTTONDOWN, pygame.MOUSEBUTTONUP):
+                    if self.current_screen and hasattr(self.current_screen, 'handle_event'):
+                        if self.current_screen.handle_event(event):
+                            running = False
--- a/trading_game/game/screens/world_map.py
+++ b/trading_game/game/screens/world_map.py
@@
-    def handle_event(self, event):
-        if self.traveling_to:
-            cancel_btn = Button(...)  # Created every time!
-            
-            if cancel_btn.handle_event(pygame.event.get()):  # Should use 'event' param
-                self.traveling_to = None
+    def __init__(self, *args, **kwargs):
+        super().__init__(*args, **kwargs)
+        # Initialize the Cancel Travel button once; it will be drawn when needed.
+        self._cancel_travel_btn = None
+
+    def _get_cancel_travel_btn(self):
+        """Lazily create the Cancel Travel button if it does not exist."""
+        if self._cancel_travel_btn is None:
+            # Replace the placeholder arguments with the actual parameters used in the original code.
+            # Example: position, size, colors, text, etc.
+            self._cancel_travel_btn = Button(
+                x=..., y=..., width=..., height=...,  # fill in with original values
+                text='Cancel Travel',
+                # other required parameters such as colors, fonts, callbacks, etc.
+            )
+        return self._cancel_travel_btn
+
+    def handle_event(self, event):
+        if self.traveling_to:
+            cancel_btn = self._get_cancel_travel_btn()
+            if cancel_btn.handle_event(event):
+                self.traveling_to = None
*** End of Patch ***