fix: chat prefix, hostile faction display, and game object looting

- Add BG_SYSTEM_NEUTRAL/ALLIANCE/HORDE chat types (0x52-0x54) and reclassify
  them as SYSTEM in the parser — prevents bogus [Say] prefix on arena/BG
  system messages
- Remove fallback [TypeName] bracket for sender-less SAY/YELL/WHISPER messages;
  only group-channel types (Party/Guild/Raid/BG) show brackets without a sender
- Remove factionTemplate != 0 guard — units with FT=0 now get setHostile() like
  any other unit (defaulting to hostile from the map default), fixing NPCs that
  appeared friendly due to unset faction template
- Enable CMSG_LOOT for WotLK type=3 (chest) game objects in addition to
  CMSG_GAMEOBJ_USE — fixes Milly's Harvest and other quest gather objects on
  AzerothCore WotLK servers
This commit is contained in:
Kelsi 2026-03-10 15:32:04 -07:00
parent 942df21c66
commit 1a370fef76
4 changed files with 52 additions and 19 deletions

View file

@ -1251,8 +1251,25 @@ void GameScreen::renderChatWindow(game::GameHandler& gameHandler) {
renderTextWithLinks(fullMsg, color);
}
} else {
std::string fullMsg = tsPrefix + "[" + std::string(getChatTypeName(msg.type)) + "] " + processedMessage;
renderTextWithLinks(fullMsg, color);
// No sender name. For group/channel types show a bracket prefix;
// for sender-specific types (SAY, YELL, WHISPER, etc.) just show the
// raw message — these are server-side announcements without a speaker.
bool isGroupType =
msg.type == game::ChatType::PARTY ||
msg.type == game::ChatType::GUILD ||
msg.type == game::ChatType::OFFICER ||
msg.type == game::ChatType::RAID ||
msg.type == game::ChatType::RAID_LEADER ||
msg.type == game::ChatType::RAID_WARNING ||
msg.type == game::ChatType::BATTLEGROUND ||
msg.type == game::ChatType::BATTLEGROUND_LEADER;
if (isGroupType) {
std::string fullMsg = tsPrefix + "[" + std::string(getChatTypeName(msg.type)) + "] " + processedMessage;
renderTextWithLinks(fullMsg, color);
} else {
// SAY, YELL, WHISPER, unknown BG_SYSTEM_* types, etc. — no prefix
renderTextWithLinks(tsPrefix + processedMessage, color);
}
}
}
@ -3421,6 +3438,9 @@ const char* GameScreen::getChatTypeName(game::ChatType type) const {
case game::ChatType::ACHIEVEMENT: return "Achievement";
case game::ChatType::DND: return "DND";
case game::ChatType::AFK: return "AFK";
case game::ChatType::BG_SYSTEM_NEUTRAL:
case game::ChatType::BG_SYSTEM_ALLIANCE:
case game::ChatType::BG_SYSTEM_HORDE: return "System";
default: return "Unknown";
}
}