Hitting !!
This commit is contained in:
@@ -302,6 +302,8 @@ export class Client {
|
||||
}
|
||||
} else if (InputManager.is_mouse_pressed(2)) {
|
||||
this.game_mode.use_item();
|
||||
} else if (!this.entity_hit && InputManager.is_mouse_pressed(0)) {
|
||||
this.game_mode.swing();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,6 +325,8 @@ export class Client {
|
||||
|
||||
if (inventories.hotbar_selected !== previous) {
|
||||
this.connection.send({ type: "select_slot", slot: inventories.hotbar_selected });
|
||||
// the server starts the attack cooldown over too
|
||||
this.player.last_attack = performance.now();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user