aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui.cpp')
-rw-r--r--src/ui.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/ui.cpp b/src/ui.cpp
index a37a97c..e10ed46 100644
--- a/src/ui.cpp
+++ b/src/ui.cpp
@@ -514,12 +514,14 @@ namespace ui {
}
}
void handleEvents(void){
- unsigned char i;
static bool left=false,right=false;
static vec2 premouse={0,0};
+ unsigned char i;
SDL_Event e;
+
mouse.x=premouse.x+offset.x-(SCREEN_WIDTH/2);
mouse.y=(offset.y+SCREEN_HEIGHT/2)-premouse.y;
+
while(SDL_PollEvent(&e)){
switch(e.type){
case SDL_QUIT:
@@ -602,9 +604,7 @@ DONE:
player->ground=false;
}
}
- if(SDL_KEY==SDLK_q){
- player->inv->itemToss();
- }
+
if(SDL_KEY==SDLK_LSHIFT)player->speed = debug?4:3; // Sprint
if(SDL_KEY==SDLK_LCTRL)player->speed = .5;
}
@@ -632,8 +632,6 @@ DONE:
}
}
- if(player->inv->tossd)player->inv->itemToss();
-
if(!dialogBoxExists&&AIpreaddr.size()){ // Flush preloaded AI functions if necessary
for(i=0;i<AIpreaddr.size();i++){
AIpreaddr.front()->addAIFunc(AIpreload.front(),false);