aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.cpp
diff options
context:
space:
mode:
authorVincent_Michael <Vincent_Michael@gmx.de>2013-01-12 02:38:34 +0100
committerVincent_Michael <Vincent_Michael@gmx.de>2013-01-12 02:38:34 +0100
commit7fbd6d33dd9546fffe81aa241463af005b3dd7d1 (patch)
tree34414f25cb51c7e98fb5eb40028a3850c3bd714c /src/server/game/Globals/ObjectMgr.cpp
parente783349803e64d0fd1879a97dcb4749435a87f05 (diff)
parent1b15bd1df2f98d1b2df417552333a847dc8526df (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into mmaps
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp31
1 files changed, 11 insertions, 20 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index b41b61904e6..2ba456b5b3c 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -2957,32 +2957,23 @@ void ObjectMgr::PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint3
sLog->outError(LOG_FILTER_SQL, "Invalid count %i specified on item %u be removed from original player create info (use -1)!", count, itemId);
uint32 RaceClass = (race_) | (class_ << 8);
- bool doneOne = false;
- for (uint32 i = 1; i < sCharStartOutfitStore.GetNumRows(); ++i)
+ for (uint32 gender = 0; gender < GENDER_NONE; ++gender)
{
- if (CharStartOutfitEntry const* entry = sCharStartOutfitStore.LookupEntry(i))
+ if (CharStartOutfitEntry const* entry = sCharStartOutfitStore.LookupEntry(RaceClass | (gender << 16)))
{
- if (entry->RaceClassGender == RaceClass || entry->RaceClassGender == (RaceClass | (1 << 16)))
+ bool found = false;
+ for (uint8 x = 0; x < MAX_OUTFIT_ITEMS; ++x)
{
- bool found = false;
- for (uint8 x = 0; x < MAX_OUTFIT_ITEMS; ++x)
+ if (entry->ItemId[x] > 0 && uint32(entry->ItemId[x]) == itemId)
{
- if (entry->ItemId[x] > 0 && uint32(entry->ItemId[x]) == itemId)
- {
- found = true;
- const_cast<CharStartOutfitEntry*>(entry)->ItemId[x] = 0;
- break;
- }
- }
-
- if (!found)
- sLog->outError(LOG_FILTER_SQL, "Item %u specified to be removed from original create info not found in dbc!", itemId);
-
- if (!doneOne)
- doneOne = true;
- else
+ found = true;
+ const_cast<CharStartOutfitEntry*>(entry)->ItemId[x] = 0;
break;
+ }
}
+
+ if (!found)
+ sLog->outError(LOG_FILTER_SQL, "Item %u specified to be removed from original create info not found in dbc!", itemId);
}
}
}