mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-02 15:53:51 +00:00
Fix buff bar updates, stair collision, and right-click aura cancel
Clear aura list on AURA_UPDATE_ALL so dismount/WMO transitions refresh properly. Increase WMO step height thresholds to reduce stair blocking. Change buff cancel to right-click and support dismount via buff bar.
This commit is contained in:
parent
b3b1cc80c6
commit
aa462fdb1f
3 changed files with 16 additions and 10 deletions
|
|
@ -3789,6 +3789,9 @@ void GameHandler::handleAuraUpdate(network::Packet& packet, bool isAll) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (auraList) {
|
if (auraList) {
|
||||||
|
if (isAll) {
|
||||||
|
auraList->clear();
|
||||||
|
}
|
||||||
for (const auto& [slot, aura] : data.updates) {
|
for (const auto& [slot, aura] : data.updates) {
|
||||||
// Ensure vector is large enough
|
// Ensure vector is large enough
|
||||||
while (auraList->size() <= slot) {
|
while (auraList->size() <= slot) {
|
||||||
|
|
|
||||||
|
|
@ -1767,7 +1767,7 @@ bool WMORenderer::checkWallCollision(const glm::vec3& from, const glm::vec3& to,
|
||||||
// Player collision parameters
|
// Player collision parameters
|
||||||
const float PLAYER_RADIUS = 0.70f; // Wider radius for better wall collision
|
const float PLAYER_RADIUS = 0.70f; // Wider radius for better wall collision
|
||||||
const float PLAYER_HEIGHT = 2.0f; // Player height for wall checks
|
const float PLAYER_HEIGHT = 2.0f; // Player height for wall checks
|
||||||
const float MAX_STEP_HEIGHT = 0.6f; // Allow stepping up stairs (lowered to catch curbs)
|
const float MAX_STEP_HEIGHT = 1.0f; // Allow stepping up stairs/ramps
|
||||||
|
|
||||||
glm::vec3 queryMin = glm::min(from, to) - glm::vec3(8.0f, 8.0f, 5.0f);
|
glm::vec3 queryMin = glm::min(from, to) - glm::vec3(8.0f, 8.0f, 5.0f);
|
||||||
glm::vec3 queryMax = glm::max(from, to) + glm::vec3(8.0f, 8.0f, 5.0f);
|
glm::vec3 queryMax = glm::max(from, to) + glm::vec3(8.0f, 8.0f, 5.0f);
|
||||||
|
|
@ -1873,7 +1873,7 @@ bool WMORenderer::checkWallCollision(const glm::vec3& from, const glm::vec3& to,
|
||||||
if (triMaxZ <= localFeetZ + MAX_STEP_HEIGHT) continue;
|
if (triMaxZ <= localFeetZ + MAX_STEP_HEIGHT) continue;
|
||||||
|
|
||||||
// Skip very short vertical surfaces (stair risers)
|
// Skip very short vertical surfaces (stair risers)
|
||||||
if (triHeight < 0.6f && triMaxZ <= localFeetZ + 0.8f) continue;
|
if (triHeight < 1.0f && triMaxZ <= localFeetZ + 1.2f) continue;
|
||||||
|
|
||||||
// Recompute distances with current (possibly pushed) localTo
|
// Recompute distances with current (possibly pushed) localTo
|
||||||
float fromDist = glm::dot(localFrom - v0, normal);
|
float fromDist = glm::dot(localFrom - v0, normal);
|
||||||
|
|
|
||||||
|
|
@ -2882,11 +2882,10 @@ void GameScreen::renderBuffBar(game::GameHandler& gameHandler) {
|
||||||
iconTex = getSpellIcon(aura.spellId, assetMgr);
|
iconTex = getSpellIcon(aura.spellId, assetMgr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool clicked = false;
|
|
||||||
if (iconTex) {
|
if (iconTex) {
|
||||||
ImGui::PushStyleColor(ImGuiCol_Button, borderColor);
|
ImGui::PushStyleColor(ImGuiCol_Button, borderColor);
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2, 2));
|
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2, 2));
|
||||||
clicked = ImGui::ImageButton("##aura",
|
ImGui::ImageButton("##aura",
|
||||||
(ImTextureID)(uintptr_t)iconTex,
|
(ImTextureID)(uintptr_t)iconTex,
|
||||||
ImVec2(ICON_SIZE - 4, ICON_SIZE - 4));
|
ImVec2(ICON_SIZE - 4, ICON_SIZE - 4));
|
||||||
ImGui::PopStyleVar();
|
ImGui::PopStyleVar();
|
||||||
|
|
@ -2895,10 +2894,19 @@ void GameScreen::renderBuffBar(game::GameHandler& gameHandler) {
|
||||||
ImGui::PushStyleColor(ImGuiCol_Button, borderColor);
|
ImGui::PushStyleColor(ImGuiCol_Button, borderColor);
|
||||||
char label[8];
|
char label[8];
|
||||||
snprintf(label, sizeof(label), "%u", aura.spellId);
|
snprintf(label, sizeof(label), "%u", aura.spellId);
|
||||||
clicked = ImGui::Button(label, ImVec2(ICON_SIZE, ICON_SIZE));
|
ImGui::Button(label, ImVec2(ICON_SIZE, ICON_SIZE));
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Right-click to cancel buffs / dismount
|
||||||
|
if (ImGui::IsItemClicked(ImGuiMouseButton_Right) && isBuff) {
|
||||||
|
if (gameHandler.isMounted()) {
|
||||||
|
gameHandler.dismount();
|
||||||
|
} else {
|
||||||
|
gameHandler.cancelAura(aura.spellId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Tooltip with spell name and duration
|
// Tooltip with spell name and duration
|
||||||
if (ImGui::IsItemHovered()) {
|
if (ImGui::IsItemHovered()) {
|
||||||
std::string name;
|
std::string name;
|
||||||
|
|
@ -2920,11 +2928,6 @@ void GameScreen::renderBuffBar(game::GameHandler& gameHandler) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Click to cancel own buffs
|
|
||||||
if (clicked && isBuff) {
|
|
||||||
gameHandler.cancelAura(aura.spellId);
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui::PopID();
|
ImGui::PopID();
|
||||||
shown++;
|
shown++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue