diff options
author | Shauren <shauren.trinity@gmail.com> | 2013-05-04 20:50:14 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2013-05-04 20:50:14 +0200 |
commit | 45bae8d4b74d772215cb22c7bb27732f55c5d9fd (patch) | |
tree | 2f6e50a09d3b68e96d3b10e506c20659ec8c36cc | |
parent | 80769a4366b8c3b3eab344a1f108273175d84852 (diff) |
Core/Players: Fixed tabard championing in normal modes of WotLK level 80 dungeons
Closes #9227
-rw-r--r-- | src/server/game/DataStores/DBCStores.cpp | 16 | ||||
-rw-r--r-- | src/server/game/DataStores/DBCStores.h | 2 | ||||
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 9 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 2 |
4 files changed, 22 insertions, 7 deletions
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 3f5ff28a6c3..11e588f8e8c 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -892,3 +892,19 @@ CharStartOutfitEntry const* GetCharStartOutfitEntry(uint8 race, uint8 class_, ui return itr->second; } + +/// Returns LFGDungeonEntry for a specific map and difficulty. Will return first found entry if multiple dungeons use the same map (such as Scarlet Monastery) +LFGDungeonEntry const* GetLFGDungeon(uint32 mapId, Difficulty difficulty) +{ + for (uint32 i = 0; i < sLFGDungeonStore.GetNumRows(); ++i) + { + LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(i); + if (!dungeon) + continue; + + if (dungeon->map == mapId && Difficulty(dungeon->difficulty) == difficulty) + return dungeon; + } + + return NULL; +} diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 0090ec7d132..3efdeec0268 100644 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -67,6 +67,8 @@ PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundB CharStartOutfitEntry const* GetCharStartOutfitEntry(uint8 race, uint8 class_, uint8 gender); +LFGDungeonEntry const* GetLFGDungeon(uint32 mapId, Difficulty difficulty); + extern DBCStorage <AchievementEntry> sAchievementStore; extern DBCStorage <AchievementCriteriaEntry> sAchievementCriteriaStore; extern DBCStorage <AreaTableEntry> sAreaStore;// recommend access using functions diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 2b39045e1e7..7117fd3bbc0 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5019,7 +5019,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC if (updateRealmChars) sWorld->UpdateRealmCharCount(accountId); - sWorld->DeleteCharacterNameData(GUID_LOPART(guid)); + sWorld->DeleteCharacterNameData(guid); } /** @@ -7036,14 +7036,11 @@ void Player::RewardReputation(Unit* victim, float rate) if (GetChampioningFaction()) { // support for: Championing - http://www.wowwiki.com/Championing - Map const* map = GetMap(); if (map && map->IsNonRaidDungeon()) - { - if (AccessRequirement const* accessRequirement = sObjectMgr->GetAccessRequirement(map->GetId(), map->GetDifficulty())) - if (accessRequirement->levelMin == 80) + if (LFGDungeonEntry const* dungeon = GetLFGDungeon(map->GetId(), map->GetDifficulty())) + if (dungeon->reclevel == 80) ChampioningFaction = GetChampioningFaction(); - } } uint32 team = GetTeam(); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index bf73feeae16..798c9371574 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2209,7 +2209,7 @@ void Unit::SendMeleeAttackStop(Unit* victim) { WorldPacket data(SMSG_ATTACKSTOP, (8+8+4)); data.append(GetPackGUID()); - data.append(victim ? victim->GetPackGUID() : 0); + data.appendPackGUID(victim ? victim->GetGUID() : 0); data << uint32(0); //! Can also take the value 0x01, which seems related to updating rotation SendMessageToSet(&data, true); sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Sent SMSG_ATTACKSTOP"); |