comparison mm7_5.cpp @ 1337:c6695ebd8fe6

Слияние
author Ritor1
date Thu, 04 Jul 2013 09:21:57 +0600
parents 3358b59b8fe8 f0be1fecd642
children 8bfdc44cebfd
comparison
equal deleted inserted replaced
1336:3358b59b8fe8 1337:c6695ebd8fe6
5240 int v3; // ebx@6 5240 int v3; // ebx@6
5241 int v4; // edi@7 5241 int v4; // edi@7
5242 unsigned int v5; // edi@14 5242 unsigned int v5; // edi@14
5243 5243
5244 v1 = this; 5244 v1 = this;
5245 LOWORD(v2) = _404544(); 5245 _404544();
5246 if ( v1->pQueue[0].field_4 <= 0 5246 if ( v1->pQueue[0].field_4 <= 0
5247 || ((_4063A1(), v2 = v1->pQueue[0].uPackedID, PID_TYPE(v1->pQueue[0].uPackedID) != OBJECT_Player) ? (uActiveCharacter = 0) : (v2 = (PID_ID(v2)) + 1, uActiveCharacter = v2), 5247 || ((_4063A1(), v2 = v1->pQueue[0].uPackedID, PID_TYPE(v1->pQueue[0].uPackedID) != OBJECT_Player) ? (uActiveCharacter = 0) : (v2 = (PID_ID(v2)) + 1, uActiveCharacter = v2),
5248 viewparams->bRedrawGameUI = 1, 5248 viewparams->bRedrawGameUI = 1,
5249 v1->pQueue[0].field_4 <= 0) ) 5249 v1->pQueue[0].field_4 <= 0) )
5250 { 5250 {
5581 } 5581 }
5582 5582
5583 //----- (00406A63) -------------------------------------------------------- 5583 //----- (00406A63) --------------------------------------------------------
5584 void stru262_TurnBased::_406A63() 5584 void stru262_TurnBased::_406A63()
5585 { 5585 {
5586 //stru262_TurnBased *v1; // ebx@1 5586 stru262_TurnBased *v1; // ebx@1
5587 //int v2; // esi@1 5587 int v2; // esi@1
5588 //unsigned __int8 v3; // zf@1 5588 unsigned __int8 v3; // zf@1
5589 //unsigned __int8 v4; // sf@1 5589 unsigned __int8 v4; // sf@1
5590 //signed int v5; // ecx@4 5590 signed int v5; // ecx@4
5591 AIDirection a3; // [sp+8h] [bp-44h]@5 5591 AIDirection a3; // [sp+8h] [bp-44h]@5
5592 AIDirection v7; // [sp+24h] [bp-28h]@5 5592 AIDirection v7; // [sp+24h] [bp-28h]@5
5593 unsigned int v8; // [sp+40h] [bp-Ch]@5 5593 unsigned int v8; // [sp+40h] [bp-Ch]@5
5594 signed int a2; // [sp+44h] [bp-8h]@1 5594 signed int a2; // [sp+44h] [bp-8h]@1
5595 //TurnBased_QueueElem *v10; // [sp+48h] [bp-4h]@2 5595 TurnBased_QueueElem *v10; // [sp+48h] [bp-4h]@2
5596 5596
5597 //v1 = this; 5597 v1 = this;
5598 //v2 = 0; 5598 v2 = 0;
5599 this->field_8 = 64; 5599 this->field_8 = 64;
5600 dword_50C994 = 0; 5600 dword_50C994 = 0;
5601 uActiveCharacter = 0; 5601 uActiveCharacter = 0;
5602 //v3 = this->uActorQueueSize == 0; 5602 v3 = this->uActorQueueSize == 0;
5603 //v4 = this->uActorQueueSize < 0; 5603 v4 = this->uActorQueueSize < 0;
5604 5604 a2 = 0;
5605 if ( this->uActorQueueSize ) 5605 if ( !(v4 | v3) )
5606 { 5606 {
5607 //v10 = this->pQueue; 5607 v10 = this->pQueue;
5608 5608 while ( 1 )
5609 for ( a2 = 0; a2 < this->uActorQueueSize; ++a2 ) 5609 {
5610 { 5610 v5 = v10->uPackedID;
5611 //v5 = this->pQueue[a2].uPackedID; 5611 if (PID_TYPE(v10->uPackedID) == OBJECT_Actor)
5612 if (PID_TYPE(this->pQueue[a2].uPackedID) == OBJECT_Actor)
5613 { 5612 {
5614 v8 = ai_near_actors_targets_pid[PID_ID(this->pQueue[a2].uPackedID)]; 5613 v8 = ai_near_actors_targets_pid[PID_ID(v5)];
5615 memcpy(&v7, Actor::GetDirectionInfo(this->pQueue[a2].uPackedID, v8, &a3, 0), sizeof(v7)); 5614 memcpy(&v7, Actor::GetDirectionInfo(v5, v8, &a3, v2), sizeof(v7));
5616 if ( !this->_406D10(a2) ) 5615 if ( !v1->_406D10(a2) )
5617 Actor::AI_Stand(PID_ID(this->pQueue[a2].uPackedID), v8, 0x20u, &v7);//actors move 5616 Actor::AI_Stand(PID_ID(v10->uPackedID), v8, 0x20u, &v7);
5618 } 5617 }
5619 //++v10; 5618 ++a2;
5620 //v2 = 0; 5619 ++v10;
5620 if ( a2 >= v1->uActorQueueSize )
5621 break;
5622 v2 = 0;
5621 } 5623 }
5622
5623 } 5624 }
5624 } 5625 }
5625 // 50C994: using guessed type int dword_50C994; 5626 // 50C994: using guessed type int dword_50C994;
5626 5627
5627 //----- (00406AFE) -------------------------------------------------------- 5628 //----- (00406AFE) --------------------------------------------------------
5672 5673
5673 //----- (00406B9F) -------------------------------------------------------- 5674 //----- (00406B9F) --------------------------------------------------------
5674 int stru262_TurnBased::_406B9F() 5675 int stru262_TurnBased::_406B9F()
5675 { 5676 {
5676 signed int result; // eax@1 5677 signed int result; // eax@1
5677 Actor *pCurrentActor; // ebx@5 5678 unsigned __int8 v2; // zf@1
5679 unsigned __int8 v3; // sf@1
5680 int v4; // esi@4
5681 unsigned int v5; // esi@5
5682 Actor *v6; // ebx@5
5683 unsigned __int16 v7; // cx@15
5678 AIDirection a3; // [sp+0h] [bp-50h]@15 5684 AIDirection a3; // [sp+0h] [bp-50h]@15
5679 AIDirection v9; // [sp+1Ch] [bp-34h]@15 5685 AIDirection v9; // [sp+1Ch] [bp-34h]@15
5686 signed int a1; // [sp+38h] [bp-18h]@4
5687 stru262_TurnBased *thisa; // [sp+3Ch] [bp-14h]@1
5680 unsigned int v12; // [sp+40h] [bp-10h]@5 5688 unsigned int v12; // [sp+40h] [bp-10h]@5
5681 unsigned int v13; // [sp+44h] [bp-Ch]@8 5689 unsigned int v13; // [sp+44h] [bp-Ch]@8
5690 TurnBased_QueueElem *v14; // [sp+48h] [bp-8h]@2
5682 signed int a2; // [sp+4Ch] [bp-4h]@1 5691 signed int a2; // [sp+4Ch] [bp-4h]@1
5683 5692
5684 result = 0; 5693 result = 0;
5685 if ( this->uActorQueueSize ) 5694 thisa = this;
5686 { 5695 v2 = this->uActorQueueSize == 0;
5687 5696 v3 = this->uActorQueueSize < 0;
5688 for ( a2 = 0; a2 < this->uActorQueueSize; ++a2 ) 5697 a2 = 0;
5689 { 5698 if ( !(v3 | v2) )
5690 if (PID_TYPE(this->pQueue[a2].uPackedID) != OBJECT_Player) 5699 {
5700 v14 = this->pQueue;
5701 while ( 1 )
5702 {
5703 v4 = v14->uPackedID;
5704 a1 = v14->uPackedID;
5705 if (PID_TYPE(a1) != OBJECT_Player)
5691 { 5706 {
5692 pCurrentActor = &pActors[PID_ID(this->pQueue[a2].uPackedID)]; 5707 v5 = PID_ID(v4);
5693 if ( pCurrentActor->pActorBuffs[5].uExpireTime <= 0 ) 5708 v12 = v5;
5694 v13 = 0; 5709 v6 = &pActors[v5];
5710 if ( SHIDWORD(v6->pActorBuffs[5].uExpireTime) < result
5711 || SHIDWORD(v6->pActorBuffs[5].uExpireTime) <= result && LODWORD(v6->pActorBuffs[5].uExpireTime) <= result )
5712 v13 = result;
5695 else 5713 else
5696 v13 = 1; 5714 v13 = 1;
5697 if ( pCurrentActor->pActorBuffs[6].uExpireTime >= 0 ) 5715 if ( SHIDWORD(v6->pActorBuffs[6].uExpireTime) >= result
5698 v12 = 1; 5716 && (SHIDWORD(v6->pActorBuffs[6].uExpireTime) > result || LODWORD(v6->pActorBuffs[6].uExpireTime) > result) )
5699 if ( !(v13 != 0 || v12 || pCurrentActor->uAIState == Dead || pCurrentActor->uAIState == Removed || pCurrentActor->uAIState == Disabled) ) 5717 result = 1;
5718 if ( !(v13 != 0 || result || v6->uAIState == 5 || v6->uAIState == 11 || v6->uAIState == 19) )
5700 { 5719 {
5701 v13 = ai_near_actors_targets_pid[PID_ID(this->pQueue[a2].uPackedID)]; 5720 v13 = ai_near_actors_targets_pid[v5];
5702 memcpy(&v9, Actor::GetDirectionInfo(this->pQueue[a2].uPackedID, v13, &a3, 0), sizeof(v9)); 5721 memcpy(&v9, Actor::GetDirectionInfo(a1, v13, &a3, 0), sizeof(v9));
5703 if ( pCurrentActor->uAIState == Pursuing || pCurrentActor->uAIState == Tethered ) 5722 v7 = v6->uAIState;
5723 if ( v7 == 6 || v7 == 1 )
5704 { 5724 {
5705 if ( (double)(signed int)v9.uDistance < 307.2 ) 5725 if ( (double)(signed int)v9.uDistance < 307.2 )
5706 { 5726 goto LABEL_26;
5707 Actor::AI_Stand(PID_ID(this->pQueue[a2].uPackedID), v13, 0x20u, &v9); 5727 }
5708 continue; 5728 v6->uCurrentActionTime += pEventTimer->uTimeElapsed;
5709 } 5729 if ( (signed int)v6->uCurrentActionTime > v6->uCurrentActionLength )
5710 } 5730 {
5711 pCurrentActor->uCurrentActionTime += pEventTimer->uTimeElapsed; 5731 if ( v7 == 4 )
5712 if ( (signed int)pCurrentActor->uCurrentActionTime > pCurrentActor->uCurrentActionLength ) 5732 {
5713 { 5733 v6->uCurrentActionTime = 0;
5714 if ( pCurrentActor->uAIState == Dying ) 5734 v6->uCurrentActionLength = 0;
5715 { 5735 v6->uAIState = Dead;
5716 pCurrentActor->uCurrentActionTime = 0; 5736 v6->UpdateAnimation();
5717 pCurrentActor->uCurrentActionLength = 0; 5737 }
5718 pCurrentActor->uAIState = Dead; 5738 if ( !thisa->_406D10(a2) )
5719 pCurrentActor->UpdateAnimation(); 5739 LABEL_26:
5720 } 5740 Actor::AI_Stand(v12, v13, 0x20u, &v9);
5721 if ( !this->_406D10(a2) )
5722 Actor::AI_Stand(PID_ID(this->pQueue[a2].uPackedID), v13, 0x20u, &v9);
5723 } 5741 }
5724 } 5742 }
5725 } 5743 }
5744 ++a2;
5745 result = (signed int)thisa;
5746 ++v14;
5747 if ( a2 >= thisa->uActorQueueSize )
5748 break;
5726 result = 0; 5749 result = 0;
5727 } 5750 }
5728
5729 } 5751 }
5730 return result; 5752 return result;
5731 } 5753 }
5732 5754
5733 //----- (00406D10) -------------------------------------------------------- 5755 //----- (00406D10) --------------------------------------------------------
5761 unsigned int v28; // [sp+48h] [bp-Ch]@10 5783 unsigned int v28; // [sp+48h] [bp-Ch]@10
5762 TurnBased_QueueElem *v29; // [sp+4Ch] [bp-8h]@7 5784 TurnBased_QueueElem *v29; // [sp+4Ch] [bp-8h]@7
5763 unsigned int uActorID; // [sp+50h] [bp-4h]@2 5785 unsigned int uActorID; // [sp+50h] [bp-4h]@2
5764 unsigned int a2a; // [sp+5Ch] [bp+8h]@7 5786 unsigned int a2a; // [sp+5Ch] [bp+8h]@7
5765 5787
5766 //__debugbreak();// 5788 // __debugbreak();//
5767 v2 = *(&this->field_0 + 4 * (a2 + 2)); 5789 v2 = *(&this->field_0 + 4 * (a2 + 2));
5768 if (PID_TYPE(v2) == OBJECT_Player) 5790 if (PID_TYPE(v2) == OBJECT_Player)
5769 return 0; 5791 return 0;
5770 uActorID = PID_ID(v2); 5792 uActorID = PID_ID(v2);
5771 //uActorID = v3; 5793 //uActorID = v3;