Core: cleanup.

*remove some garbage
*little bit moore const func
*fix process of args in vmap3_extractor
This commit is contained in:
Chaplain
2011-09-01 22:38:32 +03:00
parent 0046083509
commit bea649d045
14 changed files with 23 additions and 39 deletions
@@ -90,7 +90,7 @@ class AuctionHouseObject
typedef std::map<uint32, AuctionEntry*> AuctionEntryMap;
uint32 Getcount() { return AuctionsMap.size(); }
uint32 Getcount() const { return AuctionsMap.size(); }
AuctionEntryMap::iterator GetAuctionsBegin() {return AuctionsMap.begin();}
AuctionEntryMap::iterator GetAuctionsEnd() {return AuctionsMap.end();}
+1 -1
View File
@@ -119,7 +119,7 @@ class ChatHandler
GameObject* GetNearbyGameObject();
GameObject* GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid, uint32 entry);
bool HasSentErrorMessage() { return sentErrorMessage;}
bool HasSentErrorMessage() const { return sentErrorMessage;}
void SetSentErrorMessage(bool val){ sentErrorMessage = val;};
static bool LoadCommandTable() { return load_command_table;}
static void SetLoadCommandTable(bool val){ load_command_table = val;};
-2
View File
@@ -4208,8 +4208,6 @@ bool ChatHandler::HandleServerSetMotdCommand(const char *args)
/// Set whether we accept new clients
bool ChatHandler::HandleServerSetClosedCommand(const char *args)
{
std::string arg = args;
if (strncmp(args, "on", 3) == 0)
{
SendSysMessage(LANG_WORLD_CLOSED);
+2 -2
View File
@@ -407,11 +407,11 @@ struct Position
Position::PositionXYZStreamer PositionXYZStream()
{
return Position::PositionXYZStreamer(*this);
return PositionXYZStreamer(*this);
}
Position::PositionXYZOStreamer PositionXYZOStream()
{
return Position::PositionXYZOStreamer(*this);
return PositionXYZOStreamer(*this);
}
bool IsPositionValid() const;
@@ -56,7 +56,7 @@ class UpdateData
void AddOutOfRangeGUID(uint64 guid);
void AddUpdateBlock(const ByteBuffer &block);
bool BuildPacket(WorldPacket* packet);
bool HasData() { return m_blockCount > 0 || !m_outOfRangeGUIDs.empty(); }
bool HasData() const { return m_blockCount > 0 || !m_outOfRangeGUIDs.empty(); }
void Clear();
std::set<uint64> const& GetOutOfRangeGUIDs() const { return m_outOfRangeGUIDs; }
+3 -10
View File
@@ -7949,23 +7949,16 @@ void Player::_ApplyItemBonuses(ItemTemplate const *proto, uint8 slot, bool apply
if (CanUseAttackType(attType))
_ApplyWeaponDamage(slot, proto, ssv, apply);
int32 extraDPS = ssv->getDPSMod(proto->ScalingStatValue);
// Apply feral bonus from ScalingStatValue if set
if (ssv)
{
if (int32 feral_bonus = ssv->getFeralBonus(proto->ScalingStatValue))
ApplyFeralAPBonus(feral_bonus, apply);
}
// Druids get feral AP bonus from weapon dps (lso use DPS from ScalingStatValue)
if (getClass() == CLASS_DRUID)
{
int32 feral_bonus = proto->getFeralBonus(extraDPS);
if (feral_bonus > 0)
if (int32 feral_bonus = proto->getFeralBonus(ssv->getDPSMod(proto->ScalingStatValue)))
ApplyFeralAPBonus(feral_bonus, apply);
}
}
}
void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const *proto, ScalingStatValuesEntry const *ssv, bool apply)
{
+1 -1
View File
@@ -214,7 +214,7 @@ class Group
uint64 GetLooterGuid() const;
ItemQualities GetLootThreshold() const;
uint32 GetDbStoreId() { return m_dbStoreId; };
uint32 GetDbStoreId() const { return m_dbStoreId; };
// member manipulation methods
bool IsMember(uint64 guid) const;
+3 -3
View File
@@ -55,8 +55,8 @@ class InstanceSave
or when the instance is reset */
~InstanceSave();
uint8 GetPlayerCount() { return m_playerList.size(); }
uint8 GetGroupCount() { return m_groupList.size(); }
uint8 GetPlayerCount() const { return m_playerList.size(); }
uint8 GetGroupCount() const { return m_groupList.size(); }
/* A map corresponding to the InstanceId/MapId does not always exist.
InstanceSave objects may be created on player logon but the maps are
@@ -136,7 +136,7 @@ class InstanceSaveManager
InstResetEvent() : type(0), difficulty(DUNGEON_DIFFICULTY_NORMAL), mapid(0), instanceId(0) {}
InstResetEvent(uint8 t, uint32 _mapid, Difficulty d, uint16 _instanceid)
: type(t), difficulty(d), mapid(_mapid), instanceId(_instanceid) {}
bool operator == (const InstResetEvent& e) { return e.instanceId == instanceId; }
bool operator == (const InstResetEvent& e) const { return e.instanceId == instanceId; }
};
typedef std::multimap<time_t /*resetTime*/, InstResetEvent> ResetTimeQueue;
+1 -1
View File
@@ -101,7 +101,7 @@ class ReputationMgr
ReputationRank GetRank(FactionEntry const* factionEntry) const;
ReputationRank GetBaseRank(FactionEntry const* factionEntry) const;
uint32 GetReputationRankStrIndex(FactionEntry const* factionEntry)
uint32 GetReputationRankStrIndex(FactionEntry const* factionEntry) const
{
return ReputationRankStrIndex[GetRank(factionEntry)];
};
+1 -3
View File
@@ -364,9 +364,7 @@ void Map::ScriptsProcess()
break;
}
}
// Some information for error messages
std::string tableName = GetScriptsTableNameByType(step.script->type);
std::string commandName = GetScriptCommandName(step.script->command);
switch (step.script->command)
{
case SCRIPT_COMMAND_TALK:
@@ -2299,10 +2299,6 @@ void UnitAura::Remove(AuraRemoveMode removeMode)
void UnitAura::FillTargetMap(std::map<Unit *, uint8> & targets, Unit* caster)
{
Player* modOwner = NULL;
if (caster)
modOwner = caster->GetSpellModOwner();
for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS ; ++effIndex)
{
if (!HasEffect(effIndex))
+1 -1
View File
@@ -5857,7 +5857,7 @@ void Spell::EffectReputation(SpellEffIndex effIndex)
}
// Bonus from spells that increase reputation gain
float bonus = rep_change * _player->GetTotalAuraModifier(SPELL_AURA_MOD_REPUTATION_GAIN) / 100.0; // 10%
float bonus = rep_change * _player->GetTotalAuraModifier(SPELL_AURA_MOD_REPUTATION_GAIN) / 100.0f; // 10%
rep_change += (int32)bonus;
_player->GetReputationMgr().ModifyReputation(factionEntry, rep_change);
+2 -2
View File
@@ -313,10 +313,10 @@ public:
{
if (!creature->IsHostileTo(player))
{
uint32 Spell = 0;
if (FactionTemplateEntry const* pFaction = creature->getFactionTemplateEntry())
{
uint32 Spell = 0;
switch(pFaction->faction)
{
case 1011: Spell = SPELL_REP_LC; break;
+6 -7
View File
@@ -379,17 +379,16 @@ bool processArgv(int argc, char ** argv, const char *versionString)
{
bool result = true;
hasInputPathParam = false;
bool preciseVectorData = false;
for(int i=1; i< argc; ++i)
for (int i=1; i < argc; ++i)
{
if(strcmp("-s",argv[i]) == 0)
if (strcmp("-s", argv[i]) == 0)
{
preciseVectorData = false;
}
else if(strcmp("-d",argv[i]) == 0)
else if (strcmp("-d", argv[i]) == 0)
{
if((i+1)<argc)
if ((i + 1) < argc)
{
hasInputPathParam = true;
strcpy(input_path, argv[i+1]);
@@ -402,11 +401,11 @@ bool processArgv(int argc, char ** argv, const char *versionString)
result = false;
}
}
else if(strcmp("-?",argv[1]) == 0)
else if (strcmp("-?", argv[1]) == 0)
{
result = false;
}
else if(strcmp("-l",argv[i]) == 0)
else if (strcmp("-l", argv[i]) == 0)
{
preciseVectorData = true;
}