Core: Some optimizations

- Declare some functions const
- Fix some mem leak
- Fix some resource leak
- Remove unused variables and functions
- Remove duplicate functions
- Reduce the scope of some variables
- Remove unused file

--HG--
branch : trunk
This commit is contained in:
Spp
2010-12-06 02:07:53 +01:00
parent e226c4ac34
commit 408fce1de6
73 changed files with 200 additions and 712 deletions

View File

@@ -424,7 +424,7 @@ void ReputationMgr::SetAtWar(RepListID repListID, bool on)
SetAtWar(&itr->second,on);
}
void ReputationMgr::SetAtWar(FactionState* faction, bool atWar)
void ReputationMgr::SetAtWar(FactionState* faction, bool atWar) const
{
// not allow declare war to own faction
if (atWar && (faction->Flags & FACTION_FLAG_PEACE_FORCED))
@@ -452,7 +452,7 @@ void ReputationMgr::SetInactive(RepListID repListID, bool on)
SetInactive(&itr->second,on);
}
void ReputationMgr::SetInactive(FactionState* faction, bool inactive)
void ReputationMgr::SetInactive(FactionState* faction, bool inactive) const
{
// always invisible or hidden faction can't be inactive
if (inactive && ((faction->Flags & (FACTION_FLAG_INVISIBLE_FORCED|FACTION_FLAG_HIDDEN)) || !(faction->Flags & FACTION_FLAG_VISIBLE)))