comparison mm7_3.cpp @ 89:98cd93e14777

pointer fixes
author zipi
date Wed, 06 Feb 2013 21:19:42 +0000
parents 170259c8c71f
children 909822c91d47
comparison
equal deleted inserted replaced
88:7bdf8f1150eb 89:98cd93e14777
18614 unsigned __int16 v27; // ax@59 18614 unsigned __int16 v27; // ax@59
18615 int j; // esi@60 18615 int j; // esi@60
18616 signed int v29; // edx@66 18616 signed int v29; // edx@66
18617 char *v30; // ecx@67 18617 char *v30; // ecx@67
18618 unsigned __int16 v31; // ax@70 18618 unsigned __int16 v31; // ax@70
18619 char *v32; // eax@80 18619 Player *v32; // eax@80
18620 unsigned __int16 v33; // si@85 18620 unsigned __int16 v33; // si@85
18621 int v34; // eax@96 18621 int v34; // eax@96
18622 int v35; // eax@97 18622 int v35; // eax@97
18623 unsigned __int64 v36; // qax@99 18623 unsigned __int64 v36; // qax@99
18624 SpellBuff *v37; // ecx@99 18624 SpellBuff *v37; // ecx@99
18963 v9 = 240 * (level + 15); 18963 v9 = 240 * (level + 15);
18964 } 18964 }
18965 } 18965 }
18966 } 18966 }
18967 levela = 1; 18967 levela = 1;
18968 v32 = (char *)&pParty->pPlayers[0].pConditions[1]; 18968 v32 = pParty->pPlayers;//[0].pConditions[1];
18969 do 18969 do
18970 { 18970 {
18971 if ( *(_QWORD *)v32 ) 18971 if ( v32->pConditions[1] )
18972 levela = 0; 18972 levela = 0;
18973 v32 += 6972; 18973 ++v32;
18974 } 18974 }
18975 while ( (signed int)v32 < (signed int)&pParty->pHirelings[0].uFlags ); 18975 while ( v32 <= &pParty->pPlayers[3] );
18976 if ( !levela ) 18976 if ( !levela )
18977 return; 18977 return;
18978 pParty->pPartyBuffs[8].Apply( 18978 pParty->pPartyBuffs[8].Apply(
18979 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335), 18979 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335),
18980 v15, 18980 v15,
21114 AIDirection v31; // [sp+28h] [bp-4Ch]@10 21114 AIDirection v31; // [sp+28h] [bp-4Ch]@10
21115 AIDirection a3; // [sp+44h] [bp-30h]@10 21115 AIDirection a3; // [sp+44h] [bp-30h]@10
21116 int v33; // [sp+60h] [bp-14h]@10 21116 int v33; // [sp+60h] [bp-14h]@10
21117 int *v34; // [sp+64h] [bp-10h]@6 21117 int *v34; // [sp+64h] [bp-10h]@6
21118 int v35; // [sp+68h] [bp-Ch]@5 21118 int v35; // [sp+68h] [bp-Ch]@5
21119 int v40; // [sp+6Ch] [bp-8h]@1 21119 Player *v40; // [sp+6Ch] [bp-8h]@1
21120 int v40b;
21120 unsigned int v37; // [sp+70h] [bp-4h]@7 21121 unsigned int v37; // [sp+70h] [bp-4h]@7
21121 21122
21122 pTurnEngine->field_18 &= 0xFFFFFFFDu; 21123 pTurnEngine->field_18 &= 0xFFFFFFFDu;
21123 v1 = this; 21124 v1 = this;
21124 pEventTimer->TrackGameTime(); 21125 pEventTimer->TrackGameTime();
21125 pAudioPlayer->StopChannels(-1, -1); 21126 pAudioPlayer->StopChannels(-1, -1);
21126 v2 = 0; 21127 v2 = 0;
21127 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|SOUND_EnteringAHouse|0x1), 0, 0, -1, 0, 0, 0, 0); 21128 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|SOUND_EnteringAHouse|0x1), 0, 0, -1, 0, 0, 0, 0);
21128 v40 = (int)pParty->pPlayers; 21129 v40 = pParty->pPlayers;
21129 dword_50C998_turnbased_icon_1A = 8 * pIconsFrameTable->pIcons[uIconID_TurnStart].uAnimLength; 21130 dword_50C998_turnbased_icon_1A = 8 * pIconsFrameTable->pIcons[uIconID_TurnStart].uAnimLength;
21130 dword_50C994 = 0; 21131 dword_50C994 = 0;
21131 v1->field_10 = 100; 21132 v1->field_10 = 100;
21132 v1->field_0 = 0; 21133 v1->field_0 = 0;
21133 v1->field_8 = 64; 21134 v1->field_8 = 64;
21134 v1->field_4 = 1; 21135 v1->field_4 = 1;
21135 v1->uActorQueueSize = 0; 21136 v1->uActorQueueSize = 0;
21136 v3 = 0; 21137 v3 = 0;
21137 do 21138 do
21138 { 21139 {
21139 if ( ((Player *)v40)->CanAct() ) 21140 if ( v40->CanAct() )
21140 { 21141 {
21141 *(&v1->field_0 + 4 * (v1->uActorQueueSize + 2)) = 8 * v3 | OBJECT_Player; 21142 *(&v1->field_0 + 4 * (v1->uActorQueueSize + 2)) = 8 * v3 | OBJECT_Player;
21142 v1->pQueue[v1->uActorQueueSize].field_C = 2; 21143 v1->pQueue[v1->uActorQueueSize].field_C = 2;
21143 v1->pQueue[v1->uActorQueueSize].uActionLength = 0; 21144 v1->pQueue[v1->uActorQueueSize].uActionLength = 0;
21144 pParty->pTurnBasedPlayerRecoveryTimes[v1->uActorQueueSize++] = 0; 21145 pParty->pTurnBasedPlayerRecoveryTimes[v1->uActorQueueSize++] = 0;
21145 } 21146 }
21146 v40 += 6972; 21147 ++v40;
21147 ++v3; 21148 ++v3;
21148 } 21149 }
21149 while ( v40 < (signed int)pParty->pHirelings ); 21150 while ( v40 <=&pParty->pPlayers[3] );
21150 v35 = v1->uActorQueueSize; 21151 v35 = v1->uActorQueueSize;
21151 v4 = v35; 21152 v4 = v35;
21152 v40 = v35; 21153 v40b = v35;
21153 if ( v40 < v40 + ai_arrays_size ) 21154 if ( v40b < v40b + ai_arrays_size )
21154 { 21155 {
21155 v34 = (int *)ai_array_4F7DB0_actor_ids; 21156 v34 = (int *)ai_array_4F7DB0_actor_ids;
21156 do 21157 do
21157 { 21158 {
21158 v37 = *v34; 21159 v37 = *v34;
21177 v1->pQueue[v1->uActorQueueSize++].uActionLength = 0; 21178 v1->pQueue[v1->uActorQueueSize++].uActionLength = 0;
21178 } 21179 }
21179 } 21180 }
21180 v4 = v35; 21181 v4 = v35;
21181 } 21182 }
21182 ++v40; 21183 ++v40b;
21183 ++v34; 21184 ++v34;
21184 } 21185 }
21185 while ( v40 < v4 + ai_arrays_size ); 21186 while ( v40b < v4 + ai_arrays_size );
21186 v2 = 0; 21187 v2 = 0;
21187 } 21188 }
21188 v11 = __OFSUB__(v1->uActorQueueSize, v2); 21189 v11 = __OFSUB__(v1->uActorQueueSize, v2);
21189 v9 = v1->uActorQueueSize == v2; 21190 v9 = v1->uActorQueueSize == v2;
21190 v10 = ((v1->uActorQueueSize - v2) & 0x80000000u) != 0; 21191 v10 = ((v1->uActorQueueSize - v2) & 0x80000000u) != 0;
21191 v37 = v2; 21192 v37 = v2;
21192 v40 = v2; 21193 v40b = v2;
21193 if ( !((unsigned __int8)(v10 ^ v11) | v9) ) 21194 if ( !((unsigned __int8)(v10 ^ v11) | v9) )
21194 { 21195 {
21195 v12 = (char *)&v1->pQueue[0].field_4; 21196 v12 = (char *)&v1->pQueue[0].field_4;
21196 while ( 1 ) 21197 while ( 1 )
21197 { 21198 {
21206 LABEL_20: 21207 LABEL_20:
21207 *(int *)v12 = v16; 21208 *(int *)v12 = v16;
21208 goto LABEL_26; 21209 goto LABEL_26;
21209 } 21210 }
21210 v15 = v37++; 21211 v15 = v37++;
21211 *(&a3.uDistance + v15) = v40; 21212 *(&a3.uDistance + v15) = v40b;
21212 LABEL_26: 21213 LABEL_26:
21213 ++v40; 21214 ++v40b;
21214 v12 += 16; 21215 v12 += 16;
21215 if ( v40 >= v1->uActorQueueSize ) 21216 if ( v40b >= v1->uActorQueueSize )
21216 goto LABEL_27; 21217 goto LABEL_27;
21217 } 21218 }
21218 if ( v13 != 3 ) 21219 if ( v13 != 3 )
21219 { 21220 {
21220 *(int *)v12 = 666; 21221 *(int *)v12 = 666;
21246 { 21247 {
21247 v35 = v2; 21248 v35 = v2;
21248 v34 = (int *)1; 21249 v34 = (int *)1;
21249 do 21250 do
21250 { 21251 {
21251 v40 = (int)v34; 21252 v40b = (int)v34;
21252 if ( (signed int)v34 < (signed int)v37 ) 21253 if ( (signed int)v34 < (signed int)v37 )
21253 { 21254 {
21254 v19 = (char *)&v31.uDistance + v35; 21255 v19 = (char *)&v31.uDistance + v35;
21255 do 21256 do
21256 { 21257 {
21257 v20 = *(int *)v19; 21258 v20 = *(int *)v19;
21258 v33 = 4 * v40; 21259 v33 = 4 * v40b;
21259 v21 = (char *)(&v31.uDistance + v40); 21260 v21 = (char *)(&v31.uDistance + v40b);
21260 v22 = *(int *)v21; 21261 v22 = *(int *)v21;
21261 if ( *(int *)v21 < v20 ) 21262 if ( *(int *)v21 < v20 )
21262 { 21263 {
21263 *(int *)v21 = v20; 21264 *(int *)v21 = v20;
21264 v23 = v33; 21265 v23 = v33;
21268 v26 = *(int *)v24; 21269 v26 = *(int *)v24;
21269 *(int *)v24 = *(unsigned int *)((char *)&a3.uDistance + v35); 21270 *(int *)v24 = *(unsigned int *)((char *)&a3.uDistance + v35);
21270 *(int *)v25 = v26; 21271 *(int *)v25 = v26;
21271 v2 = 0; 21272 v2 = 0;
21272 } 21273 }
21273 ++v40; 21274 ++v40b;
21274 } 21275 }
21275 while ( v40 < (signed int)v37 ); 21276 while ( v40b < (signed int)v37 );
21276 } 21277 }
21277 v34 = (int *)((char *)v34 + 1); 21278 v34 = (int *)((char *)v34 + 1);
21278 v35 += 4; 21279 v35 += 4;
21279 } 21280 }
21280 while ( (signed int)((char *)v34 - 1) < (signed int)v37 ); 21281 while ( (signed int)((char *)v34 - 1) < (signed int)v37 );