* 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){
/*
if((e.button.button&SDL_BUTTON_RIGHT)&&dialogBoxExists){
dialogAdvance();
}
+ if((e.button.button&SDL_BUTTON_LEFT)&&!dialogBoxExists){
+ player->inv->usingi = true;
+ }
break;
/*
KEYDOWN
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.