Self / ally arts cast on the hero when pointed at an enemy
Arts with launch type 2 (buffs, auras, heals) are only valid on allies or without a target; with an enemy under the cursor the game dropped the order. Orders of a player hero for such arts lose a non-ally target, which casts them on the hero. The launch type comes from the art definition tables (game/engine/arts.h, tools/arttable.mjs). Also: skill keys check the relocated taskbar slots (all 7), Ghidra data labels (g_ names in names.txt). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
dbc632750b
commit
30c93fc87e
9 files changed
+187
-10
No files matched your search
@@ -11,6 +11,8 @@
|
||||
|
||||
#include "mods/skillkeys.h"
|
||||
|
||||
#include "mods/skillbar.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <mutex>
|
||||
|
||||
@@ -21,11 +23,6 @@
|
||||
namespace mods::skillkeys {
|
||||
namespace {
|
||||
|
||||
// cUI_Taskbar2 fields.
|
||||
constexpr size_t kTaskbarSlotCount = 0x15c; // uint16: combat-art slots the hero has
|
||||
constexpr size_t kTaskbarSkillSlots = 0x178; // 5 slot controls (null: none)
|
||||
constexpr unsigned kSlots = 5;
|
||||
|
||||
// The game window, if it has the focus (it does while a skill key is used).
|
||||
HWND GameWindow() {
|
||||
HWND window = GetForegroundWindow();
|
||||
@@ -84,9 +81,7 @@ void OnSlotSelected(void* taskbar, unsigned slot) {
|
||||
}
|
||||
const int key = g_state.pendingKey;
|
||||
g_state.pendingKey = 0;
|
||||
const auto* bar = static_cast<const uint8_t*>(taskbar);
|
||||
if (slot >= kSlots || slot >= *reinterpret_cast<const uint16_t*>(bar + kTaskbarSlotCount) ||
|
||||
!reinterpret_cast<void* const*>(bar + kTaskbarSkillSlots)[slot]) {
|
||||
if (!mods::skillbar::HasSkillSlot(taskbar, slot)) {
|
||||
return; // empty slot: nothing was selected
|
||||
}
|
||||
HWND window = GameWindow();
|
||||
@@ -118,3 +113,4 @@ void __fastcall UiTaskbar_SelectSkillSlot(void* self, void* edx, unsigned slot,
|
||||
}
|
||||
|
||||
} // namespace game
|
||||
|
||||
Reference in new issue
Block a user