mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Auto-unsheath weapons on combat engage
This commit is contained in:
parent
5d63bb0988
commit
ef6be2f186
2 changed files with 12 additions and 0 deletions
|
|
@ -352,6 +352,7 @@ void Application::logoutToLogin() {
|
|||
npcsSpawned = false;
|
||||
playerCharacterSpawned = false;
|
||||
weaponsSheathed_ = false;
|
||||
wasAutoAttacking_ = false;
|
||||
world.reset();
|
||||
if (renderer) {
|
||||
// Remove old player model so it doesn't persist into next session
|
||||
|
|
@ -409,6 +410,16 @@ void Application::update(float deltaTime) {
|
|||
auto gh2 = std::chrono::high_resolution_clock::now();
|
||||
ghTime += std::chrono::duration<float, std::milli>(gh2 - gh1).count();
|
||||
|
||||
// Always unsheath on combat engage.
|
||||
if (gameHandler) {
|
||||
const bool autoAttacking = gameHandler->isAutoAttacking();
|
||||
if (autoAttacking && !wasAutoAttacking_ && weaponsSheathed_) {
|
||||
weaponsSheathed_ = false;
|
||||
loadEquippedWeapons();
|
||||
}
|
||||
wasAutoAttacking_ = autoAttacking;
|
||||
}
|
||||
|
||||
// Toggle weapon sheathe state with Z (ignored while UI captures keyboard).
|
||||
{
|
||||
const bool uiWantsKeyboard = ImGui::GetIO().WantCaptureKeyboard;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue