diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/genrevision/genrevision.cpp | 52 | ||||
-rw-r--r-- | src/server/game/AI/SmartAI/SmartAI.cpp | 64 | ||||
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 2 | ||||
-rw-r--r-- | src/server/game/Texts/CreatureTextMgr.cpp | 2 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 2 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 2 | ||||
-rw-r--r-- | src/server/shared/Database/QueryResult.cpp | 14 | ||||
-rw-r--r-- | src/server/worldserver/Master.cpp | 1 |
8 files changed, 77 insertions, 62 deletions
diff --git a/src/genrevision/genrevision.cpp b/src/genrevision/genrevision.cpp index a10ca2eb89e..46e0fc2cbba 100644 --- a/src/genrevision/genrevision.cpp +++ b/src/genrevision/genrevision.cpp @@ -22,8 +22,6 @@ #include <stdio.h> #include <string.h> -#pragma warning(disable:4996) - std::string build_directive = "Unknown"; struct RawData @@ -110,25 +108,43 @@ void extractDataFromArchive(FILE* EntriesFile, std::string /*path*/, bool /*url* char latesttag_str[200]; char latesttagdistance_str[200]; - fgets(buf,200,EntriesFile); - sscanf(buf,"repo: %s",repo_str); - fgets(buf,200,EntriesFile); - sscanf(buf,"node: %s",hash_str); - fgets(buf,200,EntriesFile); - sscanf(buf,"branch: %s",branch_str); - fgets(buf,200,EntriesFile); - sscanf(buf,"latesttag: %[^\n]",latesttag_str); - fgets(buf,200,EntriesFile); - sscanf(buf,"latesttagdistance: %s",latesttagdistance_str); + bool error = true; + if (fgets(buf,200,EntriesFile)) + { + sscanf(buf,"repo: %s",repo_str); + if (fgets(buf,200,EntriesFile)) + { + sscanf(buf,"node: %s",hash_str); + if (fgets(buf,200,EntriesFile)) + { + sscanf(buf,"branch: %s",branch_str); + if (fgets(buf,200,EntriesFile)) + { + sscanf(buf,"latesttag: %[^\n]",latesttag_str); + if (fgets(buf,200,EntriesFile)) + { + sscanf(buf,"latesttagdistance: %s",latesttagdistance_str); + error = false; + } + } + } + } + } - char thash_str[200]; - for (int i = 11; i >= 0; --i) + if (!error) { - thash_str[i] = hash_str[i]; + char thash_str[200]; + for (int i = 11; i >= 0; --i) + thash_str[i] = hash_str[i]; + thash_str[12] = '\0'; + strcpy(data.hash_str,thash_str); + strcpy(data.rev_str,"Archive"); + } + else + { + strcpy(data.hash_str,"*"); + strcpy(data.rev_str,"*"); } - thash_str[12] = '\0'; - strcpy(data.hash_str,thash_str); - strcpy(data.rev_str,"Archive"); strcpy(data.date_str,"*"); strcpy(data.time_str,"*"); diff --git a/src/server/game/AI/SmartAI/SmartAI.cpp b/src/server/game/AI/SmartAI/SmartAI.cpp index 687c9b99601..48f3ebf9708 100644 --- a/src/server/game/AI/SmartAI/SmartAI.cpp +++ b/src/server/game/AI/SmartAI/SmartAI.cpp @@ -37,14 +37,14 @@ SmartAI::SmartAI(Creature *c) : CreatureAI(c) // copy script to local (pretection for table reload) } -int SmartAI::Permissible(const Creature *creature) +int SmartAI::Permissible(const Creature* creature) { if (creature->GetAIName() == "SmartAI") return PERMIT_BASE_SPECIAL; return PERMIT_BASE_NO; } -void SmartAI::UpdateAI(const uint32 diff) +void SmartAI::UpdateAI(const uint32 /*diff*/) { } @@ -60,7 +60,7 @@ void SmartAI::JustReachedHome() { } -void SmartAI::EnterCombat(Unit *enemy) +void SmartAI::EnterCombat(Unit* /*enemy*/) { } @@ -68,74 +68,74 @@ void SmartAI::EnterEvadeMode() { } -void SmartAI::JustDied(Unit* killer) +void SmartAI::JustDied(Unit* /*killer*/) { } -void SmartAI::KilledUnit(Unit* victim) +void SmartAI::KilledUnit(Unit* /*victim*/) { } -void SmartAI::JustSummoned(Creature* pUnit) +void SmartAI::JustSummoned(Creature* /*pUnit*/) { } -void SmartAI::AttackStart(Unit *who) +void SmartAI::AttackStart(Unit* who) { if (who && me->Attack(who, true)) me->GetMotionMaster()->MoveChase(who); } -void SmartAI::MoveInLineOfSight(Unit *who) +void SmartAI::MoveInLineOfSight(Unit* /*who*/) { //CanAIAttack } -void SmartAI::SpellHit(Unit* pUnit, const SpellEntry* pSpell) +void SmartAI::SpellHit(Unit* /*pUnit*/, const SpellEntry* /*pSpell*/) { } -void SmartAI::SpellHitTarget(Unit* target, const SpellEntry*) +void SmartAI::SpellHitTarget(Unit* /*target*/, const SpellEntry* /*pSpell*/) { } -void SmartAI::DamageTaken(Unit* done_by, uint32& damage) +void SmartAI::DamageTaken(Unit* /*done_by*/, uint32& /*damage*/) { } -void SmartAI::HealReceived(Unit* done_by, uint32& addhealth) +void SmartAI::HealReceived(Unit* /*done_by*/, uint32& /*addhealth*/) { } -void SmartAI::ReceiveEmote(Player* pPlayer, uint32 text_emote) +void SmartAI::ReceiveEmote(Player* /*pPlayer*/, uint32 /*text_emote*/) { } -void SmartAI::MovementInform(uint32 MovementType, uint32 Data) +void SmartAI::MovementInform(uint32 /*MovementType*/, uint32 /*Data*/) { } -void SmartAI::IsSummonedBy(Unit* summoner) +void SmartAI::IsSummonedBy(Unit* /*summoner*/) { } -void SmartAI::DamageDealt(Unit * done_to, uint32 & damage) +void SmartAI::DamageDealt(Unit* /*done_to*/, uint32& /*damage*/) { } -void SmartAI::SummonedCreatureDespawn(Creature* unit) +void SmartAI::SummonedCreatureDespawn(Creature* /*unit*/) { } -void SmartAI::UpdateAIWhileCharmed(const uint32 diff) +void SmartAI::UpdateAIWhileCharmed(const uint32 /*diff*/) { } -void SmartAI::CorpseRemoved(uint32 & respawnDelay) +void SmartAI::CorpseRemoved(uint32& /*respawnDelay*/) { } -void SmartAI::PassengerBoarded(Unit* who, int8 seatId, bool apply) +void SmartAI::PassengerBoarded(Unit* /*who*/, int8 /*seatId*/, bool /*apply*/) { } @@ -143,49 +143,49 @@ void SmartAI::InitializeAI() { } -void SmartAI::OnCharmed(bool apply) +void SmartAI::OnCharmed(bool /*apply*/) { } -bool SmartAI::CanAIAttack(const Unit* who) const +bool SmartAI::CanAIAttack(const Unit* /*who*/) const { return true; } -void SmartAI::DoAction(const int32 param) +void SmartAI::DoAction(const int32 /*param*/) { } -uint32 SmartAI::GetData(uint32 id) +uint32 SmartAI::GetData(uint32 /*id*/) { return 0; } -void SmartAI::SetData(uint32 id, uint32 value) +void SmartAI::SetData(uint32 /*id*/, uint32 /*value*/) { } -void SmartAI::SetGUID(const uint64 &guid, int32 id) +void SmartAI::SetGUID(const uint64& /*guid*/, int32 /*id*/) { } -uint64 SmartAI::GetGUID(int32 id) +uint64 SmartAI::GetGUID(int32 /*id*/) { return 0; } -void SmartAI::MovepointReached(uint32 id) +void SmartAI::MovepointReached(uint32 /*id*/) { } -void SmartAI::MovepointStart(uint32 id) +void SmartAI::MovepointStart(uint32 /*id*/) { } -void SmartAI::SetRun(bool run) +void SmartAI::SetRun(bool /*run*/) { } -void SmartAI::SetMovePathEndAction(SMARTAI_ACTION action) +void SmartAI::SetMovePathEndAction(SMARTAI_ACTION /*action*/) { -}
\ No newline at end of file +} diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 31adb2ddb17..37602e2a027 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -16875,7 +16875,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timediff) else { Field* fields2 = result2->Fetch(); - std::string strGUID = fields[2].GetString(); + std::string strGUID = fields2[0].GetString(); Tokens GUIDlist = StrSplit(strGUID, " "); AllowedLooterSet looters; for (Tokens::iterator itr = GUIDlist.begin(); itr != GUIDlist.end(); ++itr) diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index 9e165adc8fb..1da909b938a 100644 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -109,7 +109,7 @@ void CreatureTextMgr::LoadCreatureTexts() sLog.outString(">> Loaded %u Creature Texts for %u Creatures.", TextCount, CreatureCount); } -void CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisperGuid, ChatType msgtype, Language language, TextRange range) +void CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisperGuid, ChatType /*msgtype*/, Language /*language*/, TextRange /*range*/) { if (!source) return; diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 9c4a339da6a..925f359206b 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -343,7 +343,7 @@ public: class spell_hun_sniper_training_AuraScript : public AuraScript { - bool Validate(SpellEntry const * entry) + bool Validate(SpellEntry const * /*entry*/) { if (!sSpellStore.LookupEntry(SPELL_SNIPER_TRAINING_R1)) return false; diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index a0706ed3ac8..9bdfa43a324 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -99,7 +99,7 @@ public: class spell_pal_blessing_of_sanctuary_AuraScript : public AuraScript { - bool Validate(SpellEntry const * entry) + bool Validate(SpellEntry const* /*entry*/) { if (!sSpellStore.LookupEntry(PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF)) return false; diff --git a/src/server/shared/Database/QueryResult.cpp b/src/server/shared/Database/QueryResult.cpp index 4d330c7df33..8ce6654ace6 100644 --- a/src/server/shared/Database/QueryResult.cpp +++ b/src/server/shared/Database/QueryResult.cpp @@ -22,24 +22,24 @@ #include "Log.h" ResultSet::ResultSet(MYSQL_RES *result, MYSQL_FIELD *fields, uint64 rowCount, uint32 fieldCount) : -m_result(result), -m_fields(fields), m_rowCount(rowCount), -m_fieldCount(fieldCount) +m_fieldCount(fieldCount), +m_result(result), +m_fields(fields) { m_currentRow = new Field[m_fieldCount]; ASSERT(m_currentRow); } PreparedResultSet::PreparedResultSet(MYSQL_STMT* stmt, MYSQL_RES *result, uint64 rowCount, uint32 fieldCount) : +m_rowCount(rowCount), +m_rowPosition(0), +m_fieldCount(fieldCount), m_rBind(NULL), m_stmt(stmt), m_res(result), m_isNull(NULL), -m_length(NULL), -m_rowCount(rowCount), -m_fieldCount(fieldCount), -m_rowPosition(0) +m_length(NULL) { if (!m_res) return; diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index bf1811523bb..15ec29c140c 100644 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -146,7 +146,6 @@ public: // Launch the RA listener socket ListenSocket<RASocket> RAListenSocket (h); bool usera = sConfig.GetBoolDefault ("Ra.Enable", false); - bool needInit = true; if (usera) { |