comparison Actor.cpp @ 1288:7adc8b9b6a25

Слияние
author Ritor1
date Mon, 10 Jun 2013 09:30:21 +0600
parents 8c02e6f74b29
children fac7751b2dc9
comparison
equal deleted inserted replaced
1287:d439d5cb6837 1288:7adc8b9b6a25
38 38
39 39
40 40
41 41
42 42
43 Actor pActors[500]; 43 std::array<Actor, 500> pActors;
44 int uNumActors; 44 int uNumActors;
45 45
46 stru319 stru_50C198; // idb 46 stru319 stru_50C198; // idb
47 47
48 48
1360 { 1360 {
1361 int v4; // ebx@8 1361 int v4; // ebx@8
1362 int v5; // ST1C_4@8 1362 int v5; // ST1C_4@8
1363 int v6; // eax@8 1363 int v6; // eax@8
1364 1364
1365 auto victim = pActors + uActorID; 1365 auto victim = &pActors[uActorID];
1366 if ( a2 == 1 ) 1366 if ( a2 == 1 )
1367 BYTE2(victim->uAttributes) |= 8u; 1367 BYTE2(victim->uAttributes) |= 8u;
1368 1368
1369 for (uint i = 0; i < uNumActors; ++i) 1369 for (uint i = 0; i < uNumActors; ++i)
1370 { 1370 {
1371 auto actor = pActors + i; 1371 auto actor = &pActors[i];
1372 if (!actor->CanAct() || i == uActorID) 1372 if (!actor->CanAct() || i == uActorID)
1373 continue; 1373 continue;
1374 1374
1375 if (Actor::ArePeasantsOfSameFaction(victim, actor)) 1375 if (Actor::ArePeasantsOfSameFaction(victim, actor))
1376 { 1376 {
1933 1933
1934 //----- (00403EB6) -------------------------------------------------------- 1934 //----- (00403EB6) --------------------------------------------------------
1935 void Actor::AI_Stand(unsigned int uActorID, unsigned int object_to_face_pid, unsigned int uActionLength, AIDirection *a4) 1935 void Actor::AI_Stand(unsigned int uActorID, unsigned int object_to_face_pid, unsigned int uActionLength, AIDirection *a4)
1936 { 1936 {
1937 assert(uActorID < uNumActors); 1937 assert(uActorID < uNumActors);
1938 auto actor = pActors + uActorID; 1938 auto actor = &pActors[uActorID];
1939 1939
1940 AIDirection a3; 1940 AIDirection a3;
1941 if (!a4) 1941 if (!a4)
1942 a4 = Actor::GetDirectionInfo(PID(OBJECT_Actor, uActorID), object_to_face_pid, &a3, 0); 1942 a4 = Actor::GetDirectionInfo(PID(OBJECT_Actor, uActorID), object_to_face_pid, &a3, 0);
1943 1943
2350 v7 = uActorID; 2350 v7 = uActorID;
2351 pPlayer = &pParty->pPlayers[uActiveCharacter-1]; 2351 pPlayer = &pParty->pPlayers[uActiveCharacter-1];
2352 result = pPlayer->CanAct(); 2352 result = pPlayer->CanAct();
2353 if ( result ) 2353 if ( result )
2354 { 2354 {
2355 pCastSpellInfo->_427D48(v1); 2355 pCastSpellInfo.data()->_427D48(v1);
2356 v4 = 0; 2356 v4 = 0;
2357 v5 = pMapStats->GetMapInfo(pCurrentMapName); 2357 v5 = pMapStats->GetMapInfo(pCurrentMapName.data());
2358 if ( v5 ) 2358 if ( v5 )
2359 v4 = pMapStats->pInfos[v5]._steal_perm; 2359 v4 = pMapStats->pInfos[v5]._steal_perm;
2360 v6 = &pOutdoor->ddm; 2360 v6 = &pOutdoor->ddm;
2361 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor) 2361 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor)
2362 v6 = &pIndoor->dlv; 2362 v6 = &pIndoor->dlv;
2970 { 2970 {
2971 unsigned int v7; // eax@3 2971 unsigned int v7; // eax@3
2972 unsigned int v9; // eax@3 2972 unsigned int v9; // eax@3
2973 2973
2974 assert(uActorID < uNumActors); 2974 assert(uActorID < uNumActors);
2975 auto actor = pActors + uActorID; 2975 auto actor = &pActors[uActorID];
2976 2976
2977 AIDirection a3; // [sp+Ch] [bp-5Ch]@2 2977 AIDirection a3; // [sp+Ch] [bp-5Ch]@2
2978 if (!a4) 2978 if (!a4)
2979 a4 = Actor::GetDirectionInfo(PID(OBJECT_Actor,uActorID), uObjID, &a3, 0); 2979 a4 = Actor::GetDirectionInfo(PID(OBJECT_Actor,uActorID), uObjID, &a3, 0);
2980 2980
3474 //v20 = a2; 3474 //v20 = a2;
3475 v21 = 0; 3475 v21 = 0;
3476 //v24 = v3->uLastCharacterIDToHit; 3476 //v24 = v3->uLastCharacterIDToHit;
3477 //v26 = 0; 3477 //v26 = 0;
3478 assert(uActorID < uNumActors); 3478 assert(uActorID < uNumActors);
3479 auto _this = pActors + uActorID; 3479 auto _this = &pActors[uActorID];
3480 3480
3481 for (uint i = 0; i < uNumActors; ++i) 3481 for (uint i = 0; i < uNumActors; ++i)
3482 { 3482 {
3483 auto actor = pActors + i; 3483 auto actor = &pActors[i];
3484 //v7 = pActors; 3484 //v7 = pActors;
3485 //do 3485 //do
3486 //{ 3486 //{
3487 //v8 = v7->uAIState; 3487 //v8 = v7->uAIState;
3488 if (actor->uAIState == Dead || actor->uAIState == Dying || 3488 if (actor->uAIState == Dead || actor->uAIState == Dying ||