aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--assets/BennyHillTheme.wavbin21318852 -> 0 bytes
-rw-r--r--assets/air-horn-club-sample_1.wavbin149804 -> 0 bytes
-rw-r--r--main.cpp5
-rw-r--r--src/ui.cpp3
-rw-r--r--src/world.cpp3
5 files changed, 6 insertions, 5 deletions
diff --git a/assets/BennyHillTheme.wav b/assets/BennyHillTheme.wav
deleted file mode 100644
index a926902..0000000
--- a/assets/BennyHillTheme.wav
+++ /dev/null
Binary files differ
diff --git a/assets/air-horn-club-sample_1.wav b/assets/air-horn-club-sample_1.wav
deleted file mode 100644
index 50c5bf8..0000000
--- a/assets/air-horn-club-sample_1.wav
+++ /dev/null
Binary files differ
diff --git a/main.cpp b/main.cpp
index bde880d..b28a8da 100644
--- a/main.cpp
+++ b/main.cpp
@@ -829,11 +829,6 @@ void logic(){
* click detection is done as well for NPC/player interaction.
*
*/
- if((SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(SDL_BUTTON_LEFT)) && !ui::dialogBoxExists)player->inv->usingi = true;
- if(player->inv->usingi){
- player->inv->useItem();
- }
-
for(auto &n : currentWorld->npc){
if(n->alive){
/*
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.