From 50bfb70e9a1788e6f64800001919e3d8386eb81d Mon Sep 17 00:00:00 2001
From: Clyne Sullivan <tullivan99@gmail.com>
Date: Mon, 9 May 2016 07:42:18 -0400
Subject: world draw fixes

---
 src/ui.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'src/ui.cpp')

diff --git a/src/ui.cpp b/src/ui.cpp
index 8d15bcd..6a68cc0 100644
--- a/src/ui.cpp
+++ b/src/ui.cpp
@@ -1035,8 +1035,10 @@ EXIT:
 				} else {
 					// left click uses item
 					if (e.button.button & SDL_BUTTON_LEFT) {
-						player->inv->currentAddInteract(currentWorld->getMobs());
-						player->inv->useCurrent();
+						if ((m = currentWorld->getNearMob(*player)) != nullptr) {
+							player->inv->currentAddInteract(m);
+							player->inv->useCurrent();
+						}
 					}
 
 				}
-- 
cgit v1.2.3