diff options
-rw-r--r-- | assets/BennyHillTheme.wav | bin | 21318852 -> 0 bytes | |||
-rw-r--r-- | assets/air-horn-club-sample_1.wav | bin | 149804 -> 0 bytes | |||
-rw-r--r-- | main.cpp | 5 | ||||
-rw-r--r-- | src/ui.cpp | 3 | ||||
-rw-r--r-- | src/world.cpp | 3 |
5 files changed, 6 insertions, 5 deletions
diff --git a/assets/BennyHillTheme.wav b/assets/BennyHillTheme.wav Binary files differdeleted file mode 100644 index a926902..0000000 --- a/assets/BennyHillTheme.wav +++ /dev/null diff --git a/assets/air-horn-club-sample_1.wav b/assets/air-horn-club-sample_1.wav Binary files differdeleted file mode 100644 index 50c5bf8..0000000 --- a/assets/air-horn-club-sample_1.wav +++ /dev/null @@ -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){ /* @@ -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. |