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
@@ -53,7 +53,7 @@ class SmartScript
SmartScriptHolder CreateEvent(SMART_EVENT e, uint32 event_flags, uint32 event_param1, uint32 event_param2, uint32 event_param3, uint32 event_param4, SMART_ACTION action, uint32 action_param1, uint32 action_param2, uint32 action_param3, uint32 action_param4, uint32 action_param5, uint32 action_param6, SMARTAI_TARGETS t, uint32 target_param1, uint32 target_param2, uint32 target_param3, uint32 phaseMask = 0);
void AddEvent(SMART_EVENT e, uint32 event_flags, uint32 event_param1, uint32 event_param2, uint32 event_param3, uint32 event_param4, SMART_ACTION action, uint32 action_param1, uint32 action_param2, uint32 action_param3, uint32 action_param4, uint32 action_param5, uint32 action_param6, SMARTAI_TARGETS t, uint32 target_param1, uint32 target_param2, uint32 target_param3, uint32 phaseMask = 0);
void SetPathId(uint32 id) { mPathId = id; }
uint32 GetPathId() { return mPathId; }
uint32 GetPathId() const { return mPathId; }
WorldObject* GetBaseObject()
{
WorldObject* obj = NULL;
@@ -188,7 +188,7 @@ class SmartScript
DecPhase(abs(p));
}
void DecPhase(int32 p = 1) { mEventPhase -= (mEventPhase < (uint32)p ? (uint32)p - mEventPhase : (uint32)p); }
bool IsInPhase(uint32 p) { return mEventPhase & p; }
bool IsInPhase(uint32 p) const { return mEventPhase & p; }
void SetPhase(uint32 p = 0) { mEventPhase = p; }
SmartAIEventList mEvents;
@@ -1121,10 +1121,10 @@ struct SmartScriptHolder
SmartTarget target;
public:
uint32 GetScriptType() { return (uint32)source_type; }
uint32 GetEventType() { return (uint32)event.type; }
uint32 GetActionType() { return (uint32)action.type; }
uint32 GetTargetType() { return (uint32)target.type; }
uint32 GetScriptType() const { return (uint32)source_type; }
uint32 GetEventType() const { return (uint32)event.type; }
uint32 GetActionType() const { return (uint32)action.type; }
uint32 GetTargetType() const { return (uint32)target.type; }
uint32 timer;
bool active;