mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
fix: implement [target=pet] and [@pet] macro target specifiers
The /macrohelp listed [target=pet] as supported but the conditional evaluator didn't handle the "pet" specifier for target= or @ syntax. Now resolves to the player's active pet GUID (or skips the alternative if no pet is active). Essential for hunter/warlock macros like: /cast [target=pet] Mend Pet /cast [@pet,dead] Revive Pet
This commit is contained in:
parent
fa82d32a9f
commit
a6fe5662c8
1 changed files with 13 additions and 3 deletions
|
|
@ -5668,12 +5668,17 @@ static std::string evaluateMacroConditionals(const std::string& rawArg,
|
|||
size_t e = c.find_last_not_of(" \t"); if (e != std::string::npos) c.resize(e + 1);
|
||||
if (c.empty()) return true;
|
||||
|
||||
// @target specifiers: @player, @focus, @mouseover, @target
|
||||
// @target specifiers: @player, @focus, @pet, @mouseover, @target
|
||||
if (!c.empty() && c[0] == '@') {
|
||||
std::string spec = c.substr(1);
|
||||
if (spec == "player") tgt = gameHandler.getPlayerGuid();
|
||||
if (spec == "player") tgt = gameHandler.getPlayerGuid();
|
||||
else if (spec == "focus") tgt = gameHandler.getFocusGuid();
|
||||
else if (spec == "target") tgt = gameHandler.getTargetGuid();
|
||||
else if (spec == "pet") {
|
||||
uint64_t pg = gameHandler.getPetGuid();
|
||||
if (pg != 0) tgt = pg;
|
||||
else return false; // no pet — skip this alternative
|
||||
}
|
||||
else if (spec == "mouseover") {
|
||||
uint64_t mo = gameHandler.getMouseoverGuid();
|
||||
if (mo != 0) tgt = mo;
|
||||
|
|
@ -5684,9 +5689,14 @@ static std::string evaluateMacroConditionals(const std::string& rawArg,
|
|||
// target=X specifiers
|
||||
if (c.rfind("target=", 0) == 0) {
|
||||
std::string spec = c.substr(7);
|
||||
if (spec == "player") tgt = gameHandler.getPlayerGuid();
|
||||
if (spec == "player") tgt = gameHandler.getPlayerGuid();
|
||||
else if (spec == "focus") tgt = gameHandler.getFocusGuid();
|
||||
else if (spec == "target") tgt = gameHandler.getTargetGuid();
|
||||
else if (spec == "pet") {
|
||||
uint64_t pg = gameHandler.getPetGuid();
|
||||
if (pg != 0) tgt = pg;
|
||||
else return false; // no pet — skip this alternative
|
||||
}
|
||||
else if (spec == "mouseover") {
|
||||
uint64_t mo = gameHandler.getMouseoverGuid();
|
||||
if (mo != 0) tgt = mo;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue