aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ui.cpp3
-rw-r--r--src/world.cpp3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/ui.cpp b/src/ui.cpp
index 9ab8141..14ad64b 100644
--- a/src/ui.cpp
+++ b/src/ui.cpp
@@ -612,6 +612,9 @@ DONE:
if((e.button.button&SDL_BUTTON_RIGHT)&&dialogBoxExists){
dialogAdvance();
}
+ if((e.button.button&SDL_BUTTON_LEFT)&&!dialogBoxExists){
+ player->inv->usingi = true;
+ }
break;
/*
KEYDOWN
diff --git a/src/world.cpp b/src/world.cpp
index 2fd3591..9674b64 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -272,6 +272,9 @@ void World::update(Player *p,unsigned int delta){
p->loc.y += p->vel.y * delta;
p->loc.x +=(p->vel.x * p->speed) * delta;
+ if(p->inv->usingi){
+ p->inv->useItem();
+ }
/*
* Update coordinates of all entities except for structures.