mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[7730] Some optimizantion and code style.
Signed-off-by: AlexDereka <dereka.alex@gmail.com>
This commit is contained in:
parent
a4373c887d
commit
8144f30199
69 changed files with 536 additions and 536 deletions
|
|
@ -201,7 +201,7 @@ Unit* HostilReference::getSourceUnit()
|
|||
|
||||
void ThreatContainer::clearReferences()
|
||||
{
|
||||
for(std::list<HostilReference*>::iterator i = iThreatList.begin(); i != iThreatList.end(); ++i)
|
||||
for(std::list<HostilReference*>::const_iterator i = iThreatList.begin(); i != iThreatList.end(); ++i)
|
||||
{
|
||||
(*i)->unlink();
|
||||
delete (*i);
|
||||
|
|
@ -215,7 +215,7 @@ HostilReference* ThreatContainer::getReferenceByTarget(Unit* pVictim)
|
|||
{
|
||||
HostilReference* result = NULL;
|
||||
uint64 guid = pVictim->GetGUID();
|
||||
for(std::list<HostilReference*>::iterator i = iThreatList.begin(); i != iThreatList.end(); ++i)
|
||||
for(std::list<HostilReference*>::const_iterator i = iThreatList.begin(); i != iThreatList.end(); ++i)
|
||||
{
|
||||
if((*i)->getUnitGuid() == guid)
|
||||
{
|
||||
|
|
@ -276,10 +276,10 @@ HostilReference* ThreatContainer::selectNextVictim(Creature* pAttacker, HostilRe
|
|||
bool found = false;
|
||||
bool noPriorityTargetFound = false;
|
||||
|
||||
std::list<HostilReference*>::iterator lastRef = iThreatList.end();
|
||||
std::list<HostilReference*>::const_iterator lastRef = iThreatList.end();
|
||||
lastRef--;
|
||||
|
||||
for(std::list<HostilReference*>::iterator iter = iThreatList.begin(); iter != iThreatList.end() && !found;)
|
||||
for(std::list<HostilReference*>::const_iterator iter = iThreatList.begin(); iter != iThreatList.end() && !found;)
|
||||
{
|
||||
currentRef = (*iter);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue