1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Improve mobv2

This commit is contained in:
Perttu Ahola 2011-10-15 12:17:21 +03:00
parent 43a28f04fa
commit 5341bf59c2
11 changed files with 221 additions and 78 deletions

View file

@ -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())