aboutsummaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-10-15 12:17:21 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-10-15 12:17:21 +0300
commit5341bf59c20c770ab50b80d6b336b47ed509f8d8 (patch)
treedeb77dc90ab68027a8f840096b1419292f110507 /src/game.cpp
parent43a28f04fa3ddf4b612f58c25a896293a01567e3 (diff)
downloadminetest-5341bf59c20c770ab50b80d6b336b47ed509f8d8.tar.xz
Improve mobv2
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/game.cpp b/src/game.cpp
index e8d0238a3..926a16977 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -1532,16 +1532,23 @@ void the_game(
//if(input->getLeftClicked())
if(input->getLeftState())
{
+ bool do_punch = false;
+ bool do_punch_damage = false;
if(object_hit_delay_timer <= 0.0){
+ do_punch = true;
+ do_punch_damage = true;
+ object_hit_delay_timer = object_hit_delay;
+ }
+ if(input->getLeftClicked()){
+ do_punch = true;
+ }
+ if(do_punch){
dstream<<DTIME<<"Left-clicked object"<<std::endl;
+ left_punch = true;
+ }
+ if(do_punch_damage){
client.clickActiveObject(0,
selected_active_object->getId(), g_selected_item);
- object_hit_delay_timer = object_hit_delay;
- left_punch = true;
- } else {
- dstream<<DTIME<<"Left-clicked object faster than allowed"
- <<std::endl;
- left_punch_muted = true;
}
}
else if(input->getRightClicked())