Core/DBC: Remove store getters (useless since we don't have scripts as external dll)

This commit is contained in:
Shauren
2012-03-10 20:53:26 +01:00
parent 73282f9789
commit f85fdbebe7
12 changed files with 11 additions and 29 deletions

View File

@@ -1252,7 +1252,7 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* source, Unit* t
if ((*i).second.SoundId)
{
if (GetSoundEntriesStore()->LookupEntry((*i).second.SoundId))
if (sSoundEntriesStore.LookupEntry((*i).second.SoundId))
source->PlayDirectSound((*i).second.SoundId);
else
sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process invalid sound id %u.", textEntry, (*i).second.SoundId);

View File

@@ -171,7 +171,7 @@ void ScriptedAI::DoPlaySoundToSet(WorldObject* source, uint32 soundId)
if (!source)
return;
if (!GetSoundEntriesStore()->LookupEntry(soundId))
if (!sSoundEntriesStore.LookupEntry(soundId))
{
sLog->outError("TSCR: Invalid soundId %u used in DoPlaySoundToSet (Source: TypeId %u, GUID %u)", soundId, source->GetTypeId(), source->GetGUIDLow());
return;

View File

@@ -1545,7 +1545,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
}
case CONDITION_ACHIEVEMENT:
{
AchievementEntry const* achievement = GetAchievementStore()->LookupEntry(cond->ConditionValue1);
AchievementEntry const* achievement = sAchievementStore.LookupEntry(cond->ConditionValue1);
if (!achievement)
{
sLog->outErrorDb("Achivement condition has non existing achivement id (%u), skipped", cond->ConditionValue1);

View File

@@ -872,12 +872,3 @@ uint32 GetLiquidFlags(uint32 liquidType)
return 0;
}
// script support functions
DBCStorage <SoundEntriesEntry> const* GetSoundEntriesStore() { return &sSoundEntriesStore; }
DBCStorage <SpellRangeEntry> const* GetSpellRangeStore() { return &sSpellRangeStore; }
DBCStorage <FactionEntry> const* GetFactionStore() { return &sFactionStore; }
DBCStorage <ItemEntry> const* GetItemDisplayStore() { return &sItemStore; }
DBCStorage <CreatureDisplayInfoEntry> const* GetCreatureDisplayStore() { return &sCreatureDisplayInfoStore; }
DBCStorage <EmotesEntry> const* GetEmotesStore() { return &sEmotesStore; }
DBCStorage <EmotesTextEntry> const* GetEmotesTextStore() { return &sEmotesTextStore; }
DBCStorage <AchievementEntry> const* GetAchievementStore() { return &sAchievementStore; }

View File

@@ -175,13 +175,4 @@ extern DBCStorage <WorldSafeLocsEntry> sWorldSafeLocsStore;
void LoadDBCStores(const std::string& dataPath);
// script support functions
DBCStorage <SoundEntriesEntry> const* GetSoundEntriesStore();
DBCStorage <SpellRangeEntry> const* GetSpellRangeStore();
DBCStorage <FactionEntry> const* GetFactionStore();
DBCStorage <ItemEntry> const* GetItemDisplayStore();
DBCStorage <CreatureDisplayInfoEntry> const* GetCreatureDisplayStore();
DBCStorage <EmotesEntry> const* GetEmotesStore();
DBCStorage <EmotesTextEntry> const* GetEmotesTextStore();
DBCStorage <AchievementEntry> const* GetAchievementStore();
#endif

View File

@@ -23077,7 +23077,7 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z)
if (liquid && liquid->SpellId)
{
if (res & (LIQUID_MAP_UNDER_WATER | LIQUID_MAP_IN_WATER))
CastSpell(this, liquid->SpellId, this);
CastSpell(this, liquid->SpellId, true);
else
RemoveAurasDueToSpell(liquid->SpellId);
}

View File

@@ -181,7 +181,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* target)
if (pData->uiSoundId)
{
if (GetSoundEntriesStore()->LookupEntry(pData->uiSoundId))
if (sSoundEntriesStore.LookupEntry(pData->uiSoundId))
pSource->SendPlaySound(pData->uiSoundId, false);
else
sLog->outError("TSCR: DoScriptText entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId);

View File

@@ -67,7 +67,7 @@ void SystemMgr::LoadScriptTexts()
if (temp.uiSoundId)
{
if (!GetSoundEntriesStore()->LookupEntry(temp.uiSoundId))
if (!sSoundEntriesStore.LookupEntry(temp.uiSoundId))
sLog->outErrorDb("TSCR: Entry %i in table `script_texts` has soundId %u but sound does not exist.", iId, temp.uiSoundId);
}
@@ -129,7 +129,7 @@ void SystemMgr::LoadScriptTextsCustom()
if (temp.uiSoundId)
{
if (!GetSoundEntriesStore()->LookupEntry(temp.uiSoundId))
if (!sSoundEntriesStore.LookupEntry(temp.uiSoundId))
sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` has soundId %u but sound does not exist.", iId, temp.uiSoundId);
}

View File

@@ -67,7 +67,7 @@ public:
return false;
}
if (AchievementEntry const* achievementEntry = GetAchievementStore()->LookupEntry(achievementId))
if (AchievementEntry const* achievementEntry = sAchievementStore.LookupEntry(achievementId))
target->CompletedAchievement(achievementEntry);
return true;

View File

@@ -315,7 +315,7 @@ public:
eventTimer = 3000;
if (Creature* naralex = instance->instance->GetCreature(instance->GetData64(DATA_NARALEX)))
{
AchievementEntry const* AchievWC = GetAchievementStore()->LookupEntry(ACHIEVEMENT_WAILING_CAVERNS);
AchievementEntry const* AchievWC = sAchievementStore.LookupEntry(ACHIEVEMENT_WAILING_CAVERNS);
if (AchievWC)
{
Map* map = me->GetMap();

View File

@@ -153,7 +153,7 @@ public:
CheckPlayersFrostResist();
if (CanTheHundredClub)
{
AchievementEntry const* AchievTheHundredClub = GetAchievementStore()->LookupEntry(ACHIEVEMENT_THE_HUNDRED_CLUB);
AchievementEntry const* AchievTheHundredClub = sAchievementStore.LookupEntry(ACHIEVEMENT_THE_HUNDRED_CLUB);
if (AchievTheHundredClub)
{
if (map && map->IsDungeon())

View File

@@ -152,7 +152,7 @@ public:
if (IsHeroic() && GolemsShattered < 5)
{
AchievementEntry const* AchievShatterResistant = GetAchievementStore()->LookupEntry(ACHIEVEMENT_SHATTER_RESISTANT);
AchievementEntry const* AchievShatterResistant = sAchievementStore.LookupEntry(ACHIEVEMENT_SHATTER_RESISTANT);
if (AchievShatterResistant)
{
Map* map = me->GetMap();