Files
ClassicAPI/src
Brues f18d0a2387 C_QuestLog.IsUnitOnQuest + extract Unit::Flags::IsPlayerControlled
Modern arg-order shape (unit first, questID second; questID-keyed).
Walks the unit's +0xE68 sub-struct quest list at +0x28 — same data
source as the engine's IsUnitOnQuest(logIndex, unit). Single Lua call
covers both "is the player on it" and "is a party/raid member on it"
without making the caller find a matching log index first.

Crash hazard fix: the +0xE68 sub-struct is uninitialized for NPCs
(CGCreature_C). First attempt gated on `[unit + 0xE4] & 1` (the
engine's own pre-check before +0xE68 derefs in SetUnitBuff etc.) but
that wasn't sufficient — passing an NPC token still AV'd in the
quest-list walk. The engine's Script_IsUnitOnQuest gets away with the
weaker gate because its GUID-type-filtered ObjMgr lookup
(FUN_00468460(0x10, ...)) rejects non-player GUIDs upstream;
FUN_RESOLVE_UNIT_TOKEN doesn't have that filter. Switched to
UNIT_FLAG_PLAYER_CONTROLLED, which is the gate Item::InventoryID and
Unit::Flags already use for the same hazard.

While doing that, extracted IsPlayerControlled to Unit::Flags::
(new Flags.h) as the canonical predicate. Removed the file-static
copy in Item::InventoryID and collapsed two inline copies in
Unit::Flags (TestPlayerFlag, ReadGuildKey) to call the shared helper.
2026-05-21 13:00:20 -05:00
..
2026-05-14 14:24:11 -05:00
2026-05-09 22:15:14 -05:00
2026-05-14 14:24:11 -05:00
2026-05-17 20:50:10 -05:00
2026-05-19 18:30:13 -05:00
2026-05-19 17:32:53 -05:00
2026-05-21 00:25:20 -05:00
2026-05-16 17:58:07 -05:00
2026-05-12 21:51:46 -05:00
2026-05-14 14:24:11 -05:00
2026-05-07 10:47:34 -05:00