Fix online mode combat and implement server inventory sync

Right-click now attacks hostile NPCs (npcFlags==0) and interacts with
friendly ones in online mode. Parse UNIT_FIELD_FLAGS (59) and
UNIT_NPC_FLAGS (82) from update packets. Stop auto-attack when target
dies or despawns. Add CMSG_ITEM_QUERY_SINGLE/SMSG_ITEM_QUERY_SINGLE_RESPONSE
to populate inventory from server item objects and player slot fields.
This commit is contained in:
Kelsi 2026-02-06 03:11:43 -08:00
parent ce4299fe51
commit a3055267f6
7 changed files with 397 additions and 15 deletions

View file

@ -462,8 +462,16 @@ void GameScreen::processTargetInput(game::GameHandler& gameHandler) {
gameHandler.startAutoAttack(target->getGuid());
}
} else {
// Try NPC interaction first (gossip), fall back to attack
gameHandler.interactWithNpc(target->getGuid());
// Online mode: interact with friendly NPCs, attack hostiles
if (unit->isInteractable()) {
gameHandler.interactWithNpc(target->getGuid());
} else {
if (gameHandler.isAutoAttacking()) {
gameHandler.stopAutoAttack();
} else {
gameHandler.startAutoAttack(target->getGuid());
}
}
}
} else if (target->getType() == game::ObjectType::PLAYER) {
// Right-click another player could start attack in PvP context