Mercurial > mm7
comparison mm7_2.cpp @ 90:d61f6bc04bf2
more pointer fixes
author | zipi |
---|---|
date | Wed, 06 Feb 2013 22:32:43 +0000 |
parents | 98cd93e14777 |
children | 81e93310f73c 2fb33d31ca0d |
comparison
equal
deleted
inserted
replaced
89:98cd93e14777 | 90:d61f6bc04bf2 |
---|---|
3223 | 3223 |
3224 //----- (004BBCDD) -------------------------------------------------------- | 3224 //----- (004BBCDD) -------------------------------------------------------- |
3225 void __cdecl sub_4BBCDD() | 3225 void __cdecl sub_4BBCDD() |
3226 { | 3226 { |
3227 signed int v0; // ebp@3 | 3227 signed int v0; // ebp@3 |
3228 char *v1; // eax@4 | 3228 Actor *v1; // eax@4 |
3229 __int16 v2; // cx@5 | 3229 __int16 v2; // cx@5 |
3230 int v3; // esi@8 | 3230 int v3; // esi@8 |
3231 Player *v4; // esi@14 | 3231 Player *v4; // esi@14 |
3232 GUIButton *v5; // eax@18 | 3232 GUIButton *v5; // eax@18 |
3233 GUIButton *v6; // esi@19 | 3233 GUIButton *v6; // esi@19 |
3240 uDialogueType = 92; | 3240 uDialogueType = 92; |
3241 } | 3241 } |
3242 else | 3242 else |
3243 { | 3243 { |
3244 v0 = 0; | 3244 v0 = 0; |
3245 if ( (signed int)uNumActors <= 0 ) | 3245 if ( (signed int)uNumActors > 0 ) |
3246 goto LABEL_23; | 3246 { |
3247 v1 = (char *)&pActors[0].uAIState; | 3247 v1 = pActors;//[0].uAIState; |
3248 v7 = uNumActors; | 3248 v7 = uNumActors; |
3249 do | 3249 do |
3250 { | 3250 { |
3251 v2 = *(short *)v1; | 3251 v2 = v1->uAIState; |
3252 if ( *(short *)v1 == 5 || v2 == 11 || v2 == 19 || (v3 = *((int *)v1 + 159)) != 0 && (v3 & 7) == 4 ) | 3252 if ( v1->uAIState == 5 || v2 == 11 || v2 == 19 || (v3 = v1->uSummonerID) != 0 && (v3 & 7) == 4 ) |
3253 ++v0; | 3253 ++v0; |
3254 v1 += 836; | 3254 ++v1; |
3255 --v7; | 3255 --v7; |
3256 } | 3256 } |
3257 while ( v7 ); | 3257 while ( v7 ); |
3258 if ( v0 >= (signed int)uNumActors ) | 3258 } |
3259 { | 3259 if ( v0 >= (signed int)uNumActors || (signed int)uNumActors <= 0) |
3260 LABEL_23: | 3260 { |
3261 uDialogueType = 91; | 3261 uDialogueType = 91; |
3262 v4 = pParty->pPlayers; | 3262 v4 = pParty->pPlayers; |
3263 ++*((char *)&pParty->field_75A[3] + (unsigned __int8)pParty->field_7B5_in_arena_quest + 1); | 3263 ++*((char *)&pParty->field_75A[3] + (unsigned __int8)pParty->field_7B5_in_arena_quest + 1); |
3264 do | 3264 do |
3265 { | 3265 { |
7779 | 7779 |
7780 //----- (0044FA4C) -------------------------------------------------------- | 7780 //----- (0044FA4C) -------------------------------------------------------- |
7781 signed int __fastcall sub_44FA4C_spawn_light_elemental(int a1, int a2, int a3) | 7781 signed int __fastcall sub_44FA4C_spawn_light_elemental(int a1, int a2, int a3) |
7782 { | 7782 { |
7783 signed int v3; // ecx@6 | 7783 signed int v3; // ecx@6 |
7784 char *v4; // edx@7 | 7784 Actor *v4; // edx@7 |
7785 signed int result; // eax@13 | 7785 signed int result; // eax@13 |
7786 Actor *v6; // esi@16 | 7786 Actor *v6; // esi@16 |
7787 char *v7; // ebx@16 | 7787 char *v7; // ebx@16 |
7788 MonsterDesc *v8; // edi@16 | 7788 MonsterDesc *v8; // edi@16 |
7789 unsigned __int16 v9; // ax@16 | 7789 unsigned __int16 v9; // ax@16 |
7818 v23 = (signed __int16)pMonsterList->GetMonsterByName(v15); | 7818 v23 = (signed __int16)pMonsterList->GetMonsterByName(v15); |
7819 v3 = 0; | 7819 v3 = 0; |
7820 v20 = uNumActors; | 7820 v20 = uNumActors; |
7821 if ( (signed int)uNumActors > 0 ) | 7821 if ( (signed int)uNumActors > 0 ) |
7822 { | 7822 { |
7823 v4 = (char *)&pActors[0].uAIState; | 7823 v4 = pActors;//[0].uAIState; |
7824 while ( *(short *)v4 != Removed ) | 7824 while ( v4->uAIState != Removed ) |
7825 { | 7825 { |
7826 ++v3; | 7826 ++v3; |
7827 v4 += 836; | 7827 ++v4; |
7828 if ( v3 >= (signed int)uNumActors ) | 7828 if ( v3 >= (signed int)uNumActors ) |
7829 goto LABEL_12; | 7829 break; |
7830 } | 7830 } |
7831 v20 = v3; | 7831 if( v3 < (signed int)uNumActors ) |
7832 } | 7832 v20 = v3; |
7833 LABEL_12: | 7833 } |
7834 if ( v20 != uNumActors || (result = uNumActors + 1, (signed int)(uNumActors + 1) < 500) ) | 7834 if ( v20 != uNumActors || (result = uNumActors + 1, (signed int)(uNumActors + 1) < 500) ) |
7835 { | 7835 { |
7836 v21 = 0; | 7836 v21 = 0; |
7837 v22 = pParty->vPosition.z; | 7837 v22 = pParty->vPosition.z; |
7838 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) | 7838 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) |
15980 | 15980 |
15981 //----- (0046A89E) -------------------------------------------------------- | 15981 //----- (0046A89E) -------------------------------------------------------- |
15982 int __fastcall sub_46A89E(int a1, int a2, signed int a3) | 15982 int __fastcall sub_46A89E(int a1, int a2, signed int a3) |
15983 { | 15983 { |
15984 signed int v3; // edi@1 | 15984 signed int v3; // edi@1 |
15985 char *v4; // esi@2 | 15985 Actor *v4; // esi@2 |
15986 int v5; // ebx@3 | 15986 int v5; // ebx@3 |
15987 int v6; // eax@3 | 15987 int v6; // eax@3 |
15988 int v7; // ebx@3 | 15988 int v7; // ebx@3 |
15989 unsigned int v8; // ecx@3 | 15989 unsigned int v8; // ecx@3 |
15990 int v9; // edx@4 | 15990 int v9; // edx@4 |
16002 v15 = a2; | 16002 v15 = a2; |
16003 v16 = a1; | 16003 v16 = a1; |
16004 v19 = 0; | 16004 v19 = 0; |
16005 if ( (signed int)uNumActors > 0 ) | 16005 if ( (signed int)uNumActors > 0 ) |
16006 { | 16006 { |
16007 v4 = (char *)&pActors[0].uAIState; | 16007 v4 = pActors;//[0].uAIState; |
16008 do | 16008 do |
16009 { | 16009 { |
16010 v5 = abs(*((short *)v4 - 17) - pParty->vPosition.x); | 16010 v5 = abs(v4->vPosition.x - pParty->vPosition.x); |
16011 v17 = abs(*((short *)v4 - 16) - pParty->vPosition.y); | 16011 v17 = abs(v4->vPosition.y - pParty->vPosition.y); |
16012 v18 = abs(*((short *)v4 - 15) - pParty->vPosition.z); | 16012 v18 = abs(v4->vPosition.z - pParty->vPosition.z); |
16013 v6 = v5; | 16013 v6 = v5; |
16014 v7 = v17; | 16014 v7 = v17; |
16015 v8 = v18; | 16015 v8 = v18; |
16016 if ( v6 < v17 ) | 16016 if ( v6 < v17 ) |
16017 { | 16017 { |
16031 v8 = v7; | 16031 v8 = v7; |
16032 v7 = v11; | 16032 v7 = v11; |
16033 } | 16033 } |
16034 if ( (signed int)(((unsigned int)(11 * v7) >> 5) + (v8 >> 2) + v6) <= a3 ) | 16034 if ( (signed int)(((unsigned int)(11 * v7) >> 5) + (v8 >> 2) + v6) <= a3 ) |
16035 { | 16035 { |
16036 v12 = *(short *)v4; | 16036 v12 = v4->uAIState; |
16037 if ( *(short *)v4 != 5 ) | 16037 if ( v4->uAIState != 5 ) |
16038 { | 16038 { |
16039 if ( v12 != 4 ) | 16039 if ( v12 != 4 ) |
16040 { | 16040 { |
16041 if ( v12 != 11 ) | 16041 if ( v12 != 11 ) |
16042 { | 16042 { |
16053 } | 16053 } |
16054 } | 16054 } |
16055 } | 16055 } |
16056 } | 16056 } |
16057 ++v3; | 16057 ++v3; |
16058 v4 += 836; | 16058 ++v4; |
16059 } | 16059 } |
16060 while ( v3 < (signed int)uNumActors ); | 16060 while ( v3 < (signed int)uNumActors ); |
16061 } | 16061 } |
16062 return v19; | 16062 return v19; |
16063 } | 16063 } |
16351 | 16351 |
16352 //----- (0046BEF1) -------------------------------------------------------- | 16352 //----- (0046BEF1) -------------------------------------------------------- |
16353 void LayingItem::_46BEF1_apply_spells() | 16353 void LayingItem::_46BEF1_apply_spells() |
16354 { | 16354 { |
16355 LayingItem *v1; // edi@1 | 16355 LayingItem *v1; // edi@1 |
16356 char *v2; // esi@2 | 16356 Actor *v2; // esi@2 |
16357 __int16 v3; // fps@4 | 16357 __int16 v3; // fps@4 |
16358 unsigned __int8 v4; // c0@4 | 16358 unsigned __int8 v4; // c0@4 |
16359 unsigned __int8 v5; // c3@4 | 16359 unsigned __int8 v5; // c3@4 |
16360 signed int v6; // [sp+8h] [bp-4h]@1 | 16360 signed int v6; // [sp+8h] [bp-4h]@1 |
16361 | 16361 |
16362 v6 = 0; | 16362 v6 = 0; |
16363 v1 = this; | 16363 v1 = this; |
16364 if ( (signed int)uNumActors > 0 ) | 16364 if ( (signed int)uNumActors > 0 ) |
16365 { | 16365 { |
16366 v2 = (char *)&pActors[0].vPosition.y; | 16366 v2 = pActors;//[0].vPosition.y; |
16367 do | 16367 do |
16368 { | 16368 { |
16369 if ( ((Actor *)(v2 - 144))->CanAct() ) | 16369 if ( v2->CanAct() ) |
16370 { | 16370 { |
16371 //UNDEF(v3); | 16371 //UNDEF(v3); |
16372 if ( !(v4 | v5) ) | 16372 if ( !(v4 | v5) ) |
16373 { | 16373 { |
16374 if ( stru_50C198.GetMagicalResistance((Actor *)(v2 - 144), 0xAu) ) | 16374 if ( stru_50C198.GetMagicalResistance(v2, 0xAu) ) |
16375 { | 16375 { |
16376 ((SpellBuff *)&v2[16 * v1->field_48 + 68])->Apply( | 16376 v2->pActorBuffs[v1->field_48].Apply( |
16377 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v1->field_4C << 7) * 0.033333335), | 16377 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v1->field_4C << 7) * 0.033333335), |
16378 v1->field_50, | 16378 v1->field_50, |
16379 4u, | 16379 4u, |
16380 0, | 16380 0, |
16381 0); | 16381 0); |
16382 *(v2 - 106) |= 8u; | 16382 HIWORD(v2->uAttributes) |= 8u; |
16383 } | 16383 } |
16384 } | 16384 } |
16385 } | 16385 } |
16386 ++v6; | 16386 ++v6; |
16387 v2 += 836; | 16387 ++v2; |
16388 } | 16388 } |
16389 while ( v6 < (signed int)uNumActors ); | 16389 while ( v6 < (signed int)uNumActors ); |
16390 } | 16390 } |
16391 } | 16391 } |
16392 | 16392 |
16728 if ( v2->uItemType == 8030 ) | 16728 if ( v2->uItemType == 8030 ) |
16729 { | 16729 { |
16730 pActors[v108].uAIState = Standing; | 16730 pActors[v108].uAIState = Standing; |
16731 pActors[v108].UpdateAnimation(); | 16731 pActors[v108].UpdateAnimation(); |
16732 } | 16732 } |
16733 ((SpellBuff *)((char *)&pActors[0].pActorBuffs[v136] + v108 * 836))->Apply( | 16733 pActors[v108].pActorBuffs[v136].Apply( |
16734 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v137 << 7) * 0.033333335), | 16734 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v137 << 7) * 0.033333335), |
16735 v152, | 16735 v152, |
16736 v150, | 16736 v150, |
16737 0, | 16737 0, |
16738 0); | 16738 0); |