Mercurial > mm7
changeset 1892:9995cbcc62e0
Actor::GetActorsRelation finishing cleanup
author | Grumpy7 |
---|---|
date | Sun, 20 Oct 2013 00:21:16 -0700 |
parents | ecab40f41fe8 |
children | 7293e7e8810b |
files | Actor.cpp |
diffstat | 1 files changed, 29 insertions(+), 35 deletions(-) [+] |
line wrap: on
line diff
--- a/Actor.cpp Sun Oct 20 00:12:37 2013 -0700 +++ b/Actor.cpp Sun Oct 20 00:21:16 2013 -0700 @@ -2502,12 +2502,12 @@ { unsigned int v5; // edx@15 unsigned int v6; // eax@16 - unsigned int v7; // ebp@19 - int v8; // eax@22 - unsigned int v9; // edx@25 - unsigned int v10; // edx@33 + unsigned int thisGroup; // ebp@19 + int otherGroup; // eax@22 + unsigned int thisAlly; // edx@25 + unsigned int otherAlly; // edx@33 - if ( otherActPtr && this) + if ( otherActPtr) { v5 = otherActPtr->uGroup; v6 = this->uGroup; @@ -2515,65 +2515,59 @@ return 0; } - if ( this ) + if (this->pActorBuffs[ACTOR_BUFF_BERSERK].uExpireTime > 0) + return 4; + thisAlly = this->uAlly; + if ( this->pActorBuffs[ACTOR_BUFF_ENSLAVED].uExpireTime > 0 || thisAlly == 9999) + thisGroup = 0; + else if ( thisAlly > 0 ) { - if (this->pActorBuffs[ACTOR_BUFF_BERSERK].uExpireTime > 0) - return 4; - v9 = this->uAlly; - if ( this->pActorBuffs[ACTOR_BUFF_ENSLAVED].uExpireTime > 0 || v9 == 9999) - v7 = 0; - else if ( v9 > 0 ) - { - v7 = v9; - } - else - { - v7 = (this->pMonsterInfo.uID - 1) / 3 + 1; - } + thisGroup = thisAlly; } else { - v7 = 0; + thisGroup = (this->pMonsterInfo.uID - 1) / 3 + 1; } + if ( otherActPtr ) { if (otherActPtr->pActorBuffs[ACTOR_BUFF_BERSERK].uExpireTime > 0) return 4; - v10 = otherActPtr->uAlly; - if ( otherActPtr->pActorBuffs[ACTOR_BUFF_ENSLAVED].uExpireTime > 0 || v10 == 9999) - v8 = 0; - else if ( v10 > 0 ) + otherAlly = otherActPtr->uAlly; + if ( otherActPtr->pActorBuffs[ACTOR_BUFF_ENSLAVED].uExpireTime > 0 || otherAlly == 9999) + otherGroup = 0; + else if ( otherAlly > 0 ) { - v8 = v10; + otherGroup = otherAlly; } else { - v8 = (otherActPtr->pMonsterInfo.uID - 1) / 3 + 1; + otherGroup = (otherActPtr->pMonsterInfo.uID - 1) / 3 + 1; } } else { - v8 = 0; + otherGroup = 0; } - if ( this->pActorBuffs[ACTOR_BUFF_CHARM].uExpireTime > 0 && !v8 - || otherActPtr && otherActPtr->pActorBuffs[ACTOR_BUFF_CHARM].uExpireTime > 0 && !v7 ) + if ( this->pActorBuffs[ACTOR_BUFF_CHARM].uExpireTime > 0 && !otherGroup + || otherActPtr && otherActPtr->pActorBuffs[ACTOR_BUFF_CHARM].uExpireTime > 0 && !thisGroup ) return 0; - if ( this->pActorBuffs[ACTOR_BUFF_ENSLAVED].uExpireTime <= 0 && this->uAttributes & 0x80000 && !v8 ) + if ( this->pActorBuffs[ACTOR_BUFF_ENSLAVED].uExpireTime <= 0 && this->uAttributes & 0x80000 && !otherGroup ) return 4; - if (v7 >= 89 || v8 >= 89) + if (thisGroup >= 89 || otherGroup >= 89) return 0; - if ( v7 == 0 ) + if ( thisGroup == 0 ) { - if ( (!otherActPtr || this->pActorBuffs[ACTOR_BUFF_ENSLAVED].uExpireTime > 0 && !(otherActPtr->uAttributes & 0x80000)) && !pFactionTable->relations[v8][0]) - return pFactionTable->relations[0][v8]; + if ( (!otherActPtr || this->pActorBuffs[ACTOR_BUFF_ENSLAVED].uExpireTime > 0 && !(otherActPtr->uAttributes & 0x80000)) && !pFactionTable->relations[otherGroup][0]) + return pFactionTable->relations[0][otherGroup]; else return 4; } else { - return pFactionTable->relations[v7][v8]; + return pFactionTable->relations[thisGroup][otherGroup]; } }