Can fire directly with the mouse
This commit is contained in:
parent
1c08e2ec01
commit
e97f4b593a
@ -214,6 +214,16 @@ impl GameScreen {
|
|||||||
coordinates_mapper.get(&Coordinates::new(mouse.column, mouse.row))
|
coordinates_mapper.get(&Coordinates::new(mouse.column, mouse.row))
|
||||||
{
|
{
|
||||||
self.curr_shoot_position = *c;
|
self.curr_shoot_position = *c;
|
||||||
|
|
||||||
|
if self.can_fire()
|
||||||
|
&& self.game.can_fire_at_location(self.curr_shoot_position)
|
||||||
|
{
|
||||||
|
self.client
|
||||||
|
.send_message(&ClientMessage::Fire {
|
||||||
|
location: self.curr_shoot_position,
|
||||||
|
})
|
||||||
|
.await?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user