comparison mm7_5.cpp @ 448:ee47cc585e1b

Слияние
author Ritor1
date Sat, 23 Feb 2013 23:46:20 +0600
parents 55684f4eda73
children 58b71c1af7d8
comparison
equal deleted inserted replaced
447:7c6e68307484 448:ee47cc585e1b
4747 } 4747 }
4748 v41 = v2; 4748 v41 = v2;
4749 v37 = v3; 4749 v37 = v3;
4750 if ( stru_50FE08.field_3EC[v0] & 1 ) 4750 if ( stru_50FE08.field_3EC[v0] & 1 )
4751 { 4751 {
4752 v6 = dword_4F6E08[v3]; 4752 v6 = ai_near_actors_targets_pid[v3];
4753 v7 = v6 >> 3; 4753 v7 = v6 >> 3;
4754 v8 = (v6 & 7) - 3; 4754 v8 = (v6 & 7) - 3;
4755 uActorID = v7; 4755 uActorID = v7;
4756 if ( v8 ) 4756 if ( v8 )
4757 { 4757 {
9719 else 9719 else
9720 { 9720 {
9721 if ( v6 != 8 ) 9721 if ( v6 != 8 )
9722 goto LABEL_19; 9722 goto LABEL_19;
9723 v3 = 0; 9723 v3 = 0;
9724 Actor::AI_StandOrBored(v2->uPackedID >> 3, dword_4F6E08[v2->uPackedID >> 3], 32, 0); 9724 Actor::AI_StandOrBored(v2->uPackedID >> 3, ai_near_actors_targets_pid[v2->uPackedID >> 3], 32, 0);
9725 } 9725 }
9726 } 9726 }
9727 } 9727 }
9728 LABEL_20: 9728 LABEL_20:
9729 ++v4; 9729 ++v4;
9751 { 9751 {
9752 if ( v11 != 4 && v11 != 11 && v11 != 19 ) 9752 if ( v11 != 4 && v11 != 11 && v11 != 19 )
9753 { 9753 {
9754 if ( v11 != 17 ) 9754 if ( v11 != 17 )
9755 { 9755 {
9756 v12 = dword_4F6E08[v10]; 9756 v12 = ai_near_actors_targets_pid[v10];
9757 v9->uActionLength = v3; 9757 v9->uActionLength = v3;
9758 Actor::AI_StandOrBored(v10, v12, 32, (AIDirection *)v3); 9758 Actor::AI_StandOrBored(v10, v12, 32, (AIDirection *)v3);
9759 } 9759 }
9760 } 9760 }
9761 } 9761 }
10042 v28 = v1; 10042 v28 = v1;
10043 v3 = v1->uPackedID; 10043 v3 = v1->uPackedID;
10044 if ( (v1->uPackedID & 7) != OBJECT_Player) 10044 if ( (v1->uPackedID & 7) != OBJECT_Player)
10045 { 10045 {
10046 v4 = v3 >> 3; // turn based only stuff 10046 v4 = v3 >> 3; // turn based only stuff
10047 a2a = dword_4F6E08[v3 >> 3]; 10047 a2a = ai_near_actors_targets_pid[v3 >> 3];
10048 memcpy(&a3, Actor::GetDirectionInfo(v1->uPackedID, dword_4F6E08[v3 >> 3], &a3, 0), sizeof(a3)); 10048 memcpy(&a3, Actor::GetDirectionInfo(v1->uPackedID, ai_near_actors_targets_pid[v3 >> 3], &a3, 0), sizeof(a3));
10049 memcpy(&a4, &a3, sizeof(a4)); 10049 memcpy(&a4, &a3, sizeof(a4));
10050 v5 = &pActors[v3 >> 3]; 10050 v5 = &pActors[v3 >> 3];
10051 LOWORD(v3) = v5->uAIState; 10051 LOWORD(v3) = v5->uAIState;
10052 if ( (short)v3 != Dead ) 10052 if ( (short)v3 != Dead )
10053 { 10053 {
10187 LOWORD(v3) = v5->uAIState; 10187 LOWORD(v3) = v5->uAIState;
10188 if ( (short)v3 != 5 ) 10188 if ( (short)v3 != 5 )
10189 { 10189 {
10190 if ( (short)v3 != 4 && (short)v3 != 11 && (short)v3 != 19 && (short)v3 != 17 ) 10190 if ( (short)v3 != 4 && (short)v3 != 11 && (short)v3 != 19 && (short)v3 != 17 )
10191 { 10191 {
10192 v6 = (unsigned int *)&dword_4F6E08[(int)v4]; 10192 v6 = (unsigned int *)&ai_near_actors_targets_pid[(int)v4];
10193 Actor::_401221((unsigned int)v4, &dword_4F6E08[(int)v4], 1u); 10193 Actor::_SelectTarget((unsigned int)v4, &ai_near_actors_targets_pid[(int)v4], true);
10194 if ( v5->pMonsterInfo.uHostilityType && !*v6 ) 10194 if ( v5->pMonsterInfo.uHostilityType && !*v6 )
10195 v5->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; 10195 v5->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
10196 v22 = *v6; 10196 v22 = *v6;
10197 v7 = Actor::GetDirectionInfo(8 * (int)v4 | 3, *v6, &a3, 0); 10197 v7 = Actor::GetDirectionInfo(8 * (int)v4 | 3, *v6, &a3, 0);
10198 v8 = v5->uActorRadius; 10198 v8 = v5->uActorRadius;
10338 while ( 1 ) 10338 while ( 1 )
10339 { 10339 {
10340 v5 = v10->uPackedID; 10340 v5 = v10->uPackedID;
10341 if ( (v10->uPackedID & 7) == OBJECT_Actor) 10341 if ( (v10->uPackedID & 7) == OBJECT_Actor)
10342 { 10342 {
10343 v8 = dword_4F6E08[v5 >> 3]; 10343 v8 = ai_near_actors_targets_pid[v5 >> 3];
10344 memcpy(&v7, Actor::GetDirectionInfo(v5, v8, &a3, v2), sizeof(v7)); 10344 memcpy(&v7, Actor::GetDirectionInfo(v5, v8, &a3, v2), sizeof(v7));
10345 if ( !v1->_406D10(a2) ) 10345 if ( !v1->_406D10(a2) )
10346 Actor::AI_Stand(v10->uPackedID >> 3, v8, 0x20u, &v7); 10346 Actor::AI_Stand(v10->uPackedID >> 3, v8, 0x20u, &v7);
10347 } 10347 }
10348 ++a2; 10348 ++a2;
10382 v3 = v2->uPackedID >> 3; 10382 v3 = v2->uPackedID >> 3;
10383 v8 = v3; 10383 v8 = v3;
10384 if ( pActors[v3].CanAct() ) 10384 if ( pActors[v3].CanAct() )
10385 { 10385 {
10386 v4 = v2->uPackedID; 10386 v4 = v2->uPackedID;
10387 v9 = dword_4F6E08[v3]; 10387 v9 = ai_near_actors_targets_pid[v3];
10388 memcpy(&v6, Actor::GetDirectionInfo(v4, v9, &a3, 0), sizeof(v6)); 10388 memcpy(&v6, Actor::GetDirectionInfo(v4, v9, &a3, 0), sizeof(v6));
10389 Actor::AI_Stand(v8, v9, 0x20u, &v6); 10389 Actor::AI_Stand(v8, v9, 0x20u, &v6);
10390 v2->field_C = 0; 10390 v2->field_C = 0;
10391 v2->uActionLength = 0; 10391 v2->uActionLength = 0;
10392 v1 = v7; 10392 v1 = v7;
10445 if ( SHIDWORD(v6->pActorBuffs[6].uExpireTime) >= result 10445 if ( SHIDWORD(v6->pActorBuffs[6].uExpireTime) >= result
10446 && (SHIDWORD(v6->pActorBuffs[6].uExpireTime) > result || LODWORD(v6->pActorBuffs[6].uExpireTime) > result) ) 10446 && (SHIDWORD(v6->pActorBuffs[6].uExpireTime) > result || LODWORD(v6->pActorBuffs[6].uExpireTime) > result) )
10447 result = 1; 10447 result = 1;
10448 if ( !(v13 | result | v6->uAIState == 5 | v6->uAIState == 11 | v6->uAIState == 19) ) 10448 if ( !(v13 | result | v6->uAIState == 5 | v6->uAIState == 11 | v6->uAIState == 19) )
10449 { 10449 {
10450 v13 = dword_4F6E08[v5]; 10450 v13 = ai_near_actors_targets_pid[v5];
10451 memcpy(&v9, Actor::GetDirectionInfo(a1, v13, &a3, 0), sizeof(v9)); 10451 memcpy(&v9, Actor::GetDirectionInfo(a1, v13, &a3, 0), sizeof(v9));
10452 v7 = v6->uAIState; 10452 v7 = v6->uAIState;
10453 if ( v7 == 6 || v7 == 1 ) 10453 if ( v7 == 6 || v7 == 1 )
10454 { 10454 {
10455 if ( (double)(signed int)v9.uDistance < 307.2 ) 10455 if ( (double)(signed int)v9.uDistance < 307.2 )
10522 uActorID = v3; 10522 uActorID = v3;
10523 v4 = &pActors[v3]; 10523 v4 = &pActors[v3];
10524 v5 = v4->uAIState; 10524 v5 = v4->uAIState;
10525 if ( v5 == 5 || v5 == 4 || v5 == 11 || v5 == 19 || v5 == 17 ) 10525 if ( v5 == 5 || v5 == 4 || v5 == 11 || v5 == 19 || v5 == 17 )
10526 return 1; 10526 return 1;
10527 v6 = &dword_4F6E08[v3]; 10527 v6 = &ai_near_actors_targets_pid[v3];
10528 v7 = &pTurnEngine->pQueue[a2]; 10528 v7 = &pTurnEngine->pQueue[a2];
10529 v8 = *v6; 10529 v8 = *v6;
10530 v29 = &pTurnEngine->pQueue[a2]; 10530 v29 = &pTurnEngine->pQueue[a2];
10531 a2a = v8; 10531 a2a = v8;
10532 Actor::_401221(v3, &dword_4F6E08[v3], 1u); 10532 Actor::_SelectTarget(v3, &ai_near_actors_targets_pid[v3], true);
10533 if ( v4->pMonsterInfo.uHostilityType && !*v6 ) 10533 if ( v4->pMonsterInfo.uHostilityType && !*v6 )
10534 v4->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; 10534 v4->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
10535 v9 = Actor::GetDirectionInfo(v7->uPackedID, a2a, &a3, 0); 10535 v9 = Actor::GetDirectionInfo(v7->uPackedID, a2a, &a3, 0);
10536 v10 = v4->uActorRadius; 10536 v10 = v4->uActorRadius;
10537 memcpy(&a3, v9, sizeof(a3)); 10537 memcpy(&a3, v9, sizeof(a3));
10722 { 10722 {
10723 if ( v6 != 19 ) 10723 if ( v6 != 19 )
10724 { 10724 {
10725 if ( v6 != 17 ) 10725 if ( v6 != 17 )
10726 { 10726 {
10727 v7 = (unsigned int *)&dword_4F6E08[v4]; 10727 v7 = (unsigned int *)&ai_near_actors_targets_pid[v4];
10728 a2 = *v7; 10728 a2 = *v7;
10729 v8 = a2; 10729 v8 = a2;
10730 Actor::_401221(v4, (int *)v7, 1u); 10730 Actor::_SelectTarget(v4, (int *)v7, true);
10731 memcpy(&v11, Actor::GetDirectionInfo(*(int *)((char *)&v3->uPackedID + v18), v8, &a3, 0), sizeof(v11)); 10731 memcpy(&v11, Actor::GetDirectionInfo(*(int *)((char *)&v3->uPackedID + v18), v8, &a3, 0), sizeof(v11));
10732 memcpy(&a4, &v11, sizeof(a4)); 10732 memcpy(&a4, &v11, sizeof(a4));
10733 v5->uCurrentActionTime += pMiscTimer->uTimeElapsed; 10733 v5->uCurrentActionTime += pMiscTimer->uTimeElapsed;
10734 if ( (signed int)v5->uCurrentActionTime >= v5->uCurrentActionLength ) 10734 if ( (signed int)v5->uCurrentActionTime >= v5->uCurrentActionLength )
10735 { 10735 {
12097 if (_449B57_test_bit(pParty->_award_bits, 99)) 12097 if (_449B57_test_bit(pParty->_award_bits, 99))
12098 v7 = 1; 12098 v7 = 1;
12099 if (_449B57_test_bit(pParty->_award_bits, 100)) 12099 if (_449B57_test_bit(pParty->_award_bits, 100))
12100 v5 = 1; 12100 v5 = 1;
12101 12101
12102 Log::Warning(L"%S %S %u", __FILE__, __FUNCTION__, __LINE__); // dword_4F6E08[i] for AI_Stand seems always 0; original code behaviour is identical 12102 Log::Warning(L"%S %S %u", __FILE__, __FUNCTION__, __LINE__); // ai_near_actors_targets_pid[i] for AI_Stand seems always 0; original code behaviour is identical
12103 for (uint i = 0; i < uNumActors; ++i) 12103 for (uint i = 0; i < uNumActors; ++i)
12104 { 12104 {
12105 auto actor = pActors + i; 12105 auto actor = pActors + i;
12106 12106
12107 if (actor->CanAct() || actor->uAIState == Disabled) 12107 if (actor->CanAct() || actor->uAIState == Disabled)
12110 actor->vPosition.y = actor->vInitialPosition.y; 12110 actor->vPosition.y = actor->vInitialPosition.y;
12111 actor->vPosition.z = actor->vInitialPosition.z; 12111 actor->vPosition.z = actor->vInitialPosition.z;
12112 actor->sCurrentHP = actor->pMonsterInfo.uHP; 12112 actor->sCurrentHP = actor->pMonsterInfo.uHP;
12113 if (actor->uAIState != Disabled) 12113 if (actor->uAIState != Disabled)
12114 { 12114 {
12115 Actor::AI_Stand(i, dword_4F6E08[i], actor->pMonsterInfo.uRecoveryTime, 0); 12115 Actor::AI_Stand(i, ai_near_actors_targets_pid[i], actor->pMonsterInfo.uRecoveryTime, 0);
12116 } 12116 }
12117 } 12117 }
12118 12118
12119 actor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; 12119 actor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
12120 12120