comparison mm7_4.cpp @ 112:909822c91d47

pointer fixes
author zipi
date Sat, 09 Feb 2013 18:46:06 +0000
parents 8a10c9780e17
children 3471df3713e2 c70fea5013aa
comparison
equal deleted inserted replaced
111:bf7ea4c330b3 112:909822c91d47
77 int v4; // eax@3 77 int v4; // eax@3
78 int v5; // ebx@3 78 int v5; // ebx@3
79 unsigned int v6; // ecx@3 79 unsigned int v6; // ecx@3
80 unsigned int v7; // edx@6 80 unsigned int v7; // edx@6
81 unsigned int v8; // edx@8 81 unsigned int v8; // edx@8
82 char *v9; // edi@13 82 Actor *v9; // edi@13
83 int v10; // ebx@14 83 int v10; // ebx@14
84 int v11; // eax@14 84 int v11; // eax@14
85 int v12; // ebx@14 85 int v12; // ebx@14
86 unsigned int v13; // ecx@14 86 unsigned int v13; // ecx@14
87 int v14; // edx@15 87 int v14; // edx@15
151 if ( v1->field_2 & 2 ) 151 if ( v1->field_2 & 2 )
152 { 152 {
153 v37 = 0; 153 v37 = 0;
154 if ( (signed int)uNumActors > 0 ) 154 if ( (signed int)uNumActors > 0 )
155 { 155 {
156 v9 = (char *)&pActors[0].vPosition.y; 156 v9 = pActors;//[0].vPosition.y;
157 do 157 do
158 { 158 {
159 v10 = abs(v33 - *((short *)v9 - 1)); 159 v10 = abs(v33 - v9->vPosition.x);
160 v29 = abs(v32 - *(short *)v9); 160 v29 = abs(v32 - v9->vPosition.y);
161 v26 = abs(v35 - *((short *)v9 + 1)); 161 v26 = abs(v35 - v9->vPosition.z);
162 v11 = v10; 162 v11 = v10;
163 v12 = v29; 163 v12 = v29;
164 v13 = v26; 164 v13 = v26;
165 if ( v11 < v29 ) 165 if ( v11 < v29 )
166 { 166 {
181 v12 = v16; 181 v12 = v16;
182 } 182 }
183 if ( (signed int)(((unsigned int)(11 * v12) >> 5) + (v13 >> 2) + v11) < v31 ) 183 if ( (signed int)(((unsigned int)(11 * v12) >> 5) + (v13 >> 2) + v11) < v31 )
184 EventProcessor(v1->field_16_event_id, 0, 1); 184 EventProcessor(v1->field_16_event_id, 0, 1);
185 ++v37; 185 ++v37;
186 v9 += 836; 186 ++v9;
187 } 187 }
188 while ( v37 < (signed int)uNumActors ); 188 while ( v37 < (signed int)uNumActors );
189 } 189 }
190 } 190 }
191 if ( v1->field_2 & 4 ) 191 if ( v1->field_2 & 4 )
3397 signed __int64 v1; // qax@1 3397 signed __int64 v1; // qax@1
3398 int v2; // ecx@1 3398 int v2; // ecx@1
3399 int result; // eax@1 3399 int result; // eax@1
3400 int v4; // eax@2 3400 int v4; // eax@2
3401 int v5; // edi@5 3401 int v5; // edi@5
3402 char *v6; // ecx@5 3402 int *v6; // ecx@5
3403 char v7; // sf@5 3403 char v7; // sf@5
3404 char *v8; // ecx@10 3404 int *v8; // ecx@10
3405 int v9; // edi@15 3405 int v9; // edi@15
3406 signed int v10; // eax@15 3406 signed int v10; // eax@15
3407 __int16 *v11; // edx@16 3407 __int16 *v11; // edx@16
3408 int v12; // eax@20 3408 int v12; // eax@20
3409 int v13; // ebx@20 3409 int v13; // ebx@20
3460 { 3460 {
3461 if ( !(pParty->pPartyBuffs[7].uFlags & 1) ) 3461 if ( !(pParty->pPartyBuffs[7].uFlags & 1) )
3462 { 3462 {
3463 v5 = v4 * pParty->pPartyBuffs[7].uPower; 3463 v5 = v4 * pParty->pPartyBuffs[7].uPower;
3464 __debugbreak(); 3464 __debugbreak();
3465 v6 = &stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[7].uCaster + 2000]; 3465 v6 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[7].uCaster].pConditions[0];//&stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[7].uCaster + 2000];
3466 v7 = *(int *)v6 - v5 < 0; 3466 v7 = *v6 < v5;
3467 *(int *)v6 -= v5; 3467 *v6 -= v5;
3468 if ( v7 ) 3468 if ( v7 )
3469 { 3469 {
3470 *(int *)v6 = 0; 3470 *v6 = 0;
3471 pParty->uFlags &= 0xFFFFFFBFu; 3471 pParty->uFlags &= 0xFFFFFFBFu;
3472 pParty->bFlying = 0; 3472 pParty->bFlying = 0;
3473 v51 = 1; 3473 v51 = 1;
3474 } 3474 }
3475 } 3475 }
3480 if (pParty->uFlags & 0x80 ) 3480 if (pParty->uFlags & 0x80 )
3481 { 3481 {
3482 if ( !(pParty->pPartyBuffs[18].uFlags & 1) ) 3482 if ( !(pParty->pPartyBuffs[18].uFlags & 1) )
3483 { 3483 {
3484 __debugbreak(); 3484 __debugbreak();
3485 v8 = &stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[18].uCaster + 2000]; 3485 v8 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[18].uCaster].pConditions[0];//&stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[18].uCaster + 2000];
3486 v7 = *(int *)v8 - v4 < 0; 3486 v7 = *v8 < v4;
3487 *(int *)v8 -= v4; 3487 *v8 -= v4;
3488 if ( v7 ) 3488 if ( v7 )
3489 { 3489 {
3490 *(int *)v8 = 0; 3490 *v8 = 0;
3491 LOBYTE(pParty->uFlags) &= 0x7Fu; 3491 LOBYTE(pParty->uFlags) &= 0x7Fu;
3492 v51 = 1; 3492 v51 = 1;
3493 } 3493 }
3494 } 3494 }
3495 } 3495 }
9212 signed __int64 v1; // ST2C_8@1 9212 signed __int64 v1; // ST2C_8@1
9213 signed __int64 v2; // qax@1 9213 signed __int64 v2; // qax@1
9214 signed __int64 v3; // ST1C_8@1 9214 signed __int64 v3; // ST1C_8@1
9215 unsigned __int64 v4; // qax@1 9215 unsigned __int64 v4; // qax@1
9216 unsigned int v5; // ebx@1 9216 unsigned int v5; // ebx@1
9217 void *v6; // ebx@1 9217 Player *v6; // ebx@1
9218 9218
9219 pParty->pHirelings[0].bHasUsedTheAbility = 0; 9219 pParty->pHirelings[0].bHasUsedTheAbility = 0;
9220 pParty->pHirelings[1].bHasUsedTheAbility = 0; 9220 pParty->pHirelings[1].bHasUsedTheAbility = 0;
9221 pParty->uTimePlayed += (signed __int64)((double)(7680 * uNumMinutes) * 0.033333335); 9221 pParty->uTimePlayed += (signed __int64)((double)(7680 * uNumMinutes) * 0.033333335);
9222 v1 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375); 9222 v1 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375);
9231 pParty->uDaysPlayed = (unsigned int)v4 % 0x1C; 9231 pParty->uDaysPlayed = (unsigned int)v4 % 0x1C;
9232 pParty->uCurrentMonth = v5 % 0xC; 9232 pParty->uCurrentMonth = v5 % 0xC;
9233 pParty->uCurrentYear = v5 / 0xC + 1168; 9233 pParty->uCurrentYear = v5 / 0xC + 1168;
9234 pParty->RestAndHeal(); 9234 pParty->RestAndHeal();
9235 dword_507B94 = 1; 9235 dword_507B94 = 1;
9236 v6 = &pParty->pPlayers[0].uNumDivineInterventionCastsThisDay; 9236 v6 = pParty->pPlayers;//[0].uNumDivineInterventionCastsThisDay;
9237 do 9237 do
9238 { 9238 {
9239 *((short *)v6 - 258) = 0; 9239 v6->uTimeToRecovery = 0;
9240 memset(v6, 0, 4u); 9240 memset(&v6->uTimeToRecovery, 0, 4u);
9241 v6 = (char *)v6 + 6972; 9241 ++v6;
9242 } 9242 }
9243 while ( (signed int)v6 < (signed int)&pParty->field_871C[694] ); 9243 while ( v6 <= &pParty->pPlayers[3] );
9244 pParty->_4909F4(); 9244 pParty->_4909F4();
9245 } 9245 }
9246 // 507B94: using guessed type int dword_507B94; 9246 // 507B94: using guessed type int dword_507B94;
9247 9247
9248 //----- (004B1D27) -------------------------------------------------------- 9248 //----- (004B1D27) --------------------------------------------------------
15090 signed int v8; // eax@10 15090 signed int v8; // eax@10
15091 int v9; // esi@10 15091 int v9; // esi@10
15092 unsigned int v10; // esi@16 15092 unsigned int v10; // esi@16
15093 int v11; // ecx@17 15093 int v11; // ecx@17
15094 unsigned int v12; // kr00_4@25 15094 unsigned int v12; // kr00_4@25
15095 void *v13; // esi@25 15095 Player *v13; // esi@25
15096 int v14; // eax@25 15096 int v14; // eax@25
15097 Player *v15; // esi@27 15097 Player *v15; // esi@27
15098 signed int v16; // eax@32 15098 signed int v16; // eax@32
15099 unsigned int v17; // eax@37 15099 unsigned int v17; // eax@37
15100 signed int v18; // edi@37 15100 signed int v18; // edi@37
15187 { 15187 {
15188 uCurrentHouse_Animation = (signed __int16)p2DEvents[186].uAnimationID; 15188 uCurrentHouse_Animation = (signed __int16)p2DEvents[186].uAnimationID;
15189 v25 = (HOUSE_TYPE)187; 15189 v25 = (HOUSE_TYPE)187;
15190 v12 = LODWORD(pParty->uTimePlayed); 15190 v12 = LODWORD(pParty->uTimePlayed);
15191 LODWORD(pParty->uTimePlayed) += 0x7620000u; 15191 LODWORD(pParty->uTimePlayed) += 0x7620000u;
15192 v13 = &pParty->pPlayers[0].uNumDivineInterventionCastsThisDay; 15192 v13 = pParty->pPlayers;//[0].uNumDivineInterventionCastsThisDay;
15193 v14 = LOBYTE(pAnimatedRooms[(signed __int16)p2DEvents[186].uAnimationID].field_C); 15193 v14 = LOBYTE(pAnimatedRooms[(signed __int16)p2DEvents[186].uAnimationID].field_C);
15194 pParty->uTimePlayed = __PAIR__(HIDWORD(pParty->uTimePlayed), v12) + 0x7620000; 15194 pParty->uTimePlayed = __PAIR__(HIDWORD(pParty->uTimePlayed), v12) + 0x7620000;
15195 dword_F8B198 = v14; 15195 dword_F8B198 = v14;
15196 do 15196 do
15197 { 15197 {
15198 *((short *)v13 - 258) = 0; 15198 v13->uTimeToRecovery = 0;
15199 memset(v13, 0, 4u); 15199 memset(&v13->uTimeToRecovery, 0, 4u);
15200 v13 = (char *)v13 + 6972; 15200 ++v13;
15201 } 15201 }
15202 while ( (signed int)v13 < (signed int)&pParty->field_871C[694] ); 15202 while ( v13 <= &pParty->pPlayers[3] );
15203 ++pParty->uNumPrisonTerms; 15203 ++pParty->uNumPrisonTerms;
15204 pParty->uFine = 0; 15204 pParty->uFine = 0;
15205 v15 = pParty->pPlayers; 15205 v15 = pParty->pPlayers;
15206 do 15206 do
15207 { 15207 {
15208 v15->SetVariable(VAR_Award, 87); 15208 v15->SetVariable(VAR_Award, 87);
15209 ++v15; 15209 ++v15;
15210 } 15210 }
15211 while ( (signed int)v15 < (signed int)pParty->pHirelings ); 15211 while ( v15 <= &pParty->pPlayers[3] );
15212 v10 = v25; 15212 v10 = v25;
15213 } 15213 }
15214 ++pIcons_LOD->uTexturePacksCount; 15214 ++pIcons_LOD->uTexturePacksCount;
15215 if ( !pIcons_LOD->uNumPrevLoadedFiles ) 15215 if ( !pIcons_LOD->uNumPrevLoadedFiles )
15216 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; 15216 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;