comparison mm7_6.cpp @ 90:d61f6bc04bf2

more pointer fixes
author zipi
date Wed, 06 Feb 2013 22:32:43 +0000
parents 98cd93e14777
children 909822c91d47
comparison
equal deleted inserted replaced
89:98cd93e14777 90:d61f6bc04bf2
3061 SpellBuff *v513; // edi@946 3061 SpellBuff *v513; // edi@946
3062 int v514; // ecx@950 3062 int v514; // ecx@950
3063 int v515; // ecx@951 3063 int v515; // ecx@951
3064 int v516; // eax@953 3064 int v516; // eax@953
3065 int v517; // eax@956 3065 int v517; // eax@956
3066 char *v518; // edx@957 3066 Actor *v518; // edx@957
3067 __int16 v519; // cx@958 3067 __int16 v519; // cx@958
3068 int v520; // ecx@968 3068 int v520; // ecx@968
3069 int v521; // ecx@969 3069 int v521; // ecx@969
3070 int v522; // eax@971 3070 int v522; // eax@971
3071 __int16 v523; // ST18_2@975 3071 __int16 v523; // ST18_2@975
3270 //LayingItem a1; // [sp+DDCh] [bp-A8h]@1 3270 //LayingItem a1; // [sp+DDCh] [bp-A8h]@1
3271 int v723; // [sp+E4Ch] [bp-38h]@1 3271 int v723; // [sp+E4Ch] [bp-38h]@1
3272 ItemGen *_this; // [sp+E50h] [bp-34h]@23 3272 ItemGen *_this; // [sp+E50h] [bp-34h]@23
3273 float v725; // [sp+E54h] [bp-30h]@23 3273 float v725; // [sp+E54h] [bp-30h]@23
3274 Player *v726; // [sp+E58h] [bp-2Ch]@131 3274 Player *v726; // [sp+E58h] [bp-2Ch]@131
3275 int v726b;
3275 float v727; // [sp+E5Ch] [bp-28h]@1 3276 float v727; // [sp+E5Ch] [bp-28h]@1
3276 unsigned int uRequiredMana; // [sp+E60h] [bp-24h]@53 3277 unsigned int uRequiredMana; // [sp+E60h] [bp-24h]@53
3277 Player *pPlayer; // [sp+E64h] [bp-20h]@8 3278 Player *pPlayer; // [sp+E64h] [bp-20h]@8
3278 int v730; // [sp+E68h] [bp-1Ch]@53 3279 int v730; // [sp+E68h] [bp-1Ch]@53
3279 Player *v730b; 3280 Player *v730b;
3706 case 44: 3707 case 44:
3707 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 3708 if ( !pPlayer->CanCastSpell(uRequiredMana) )
3708 goto LABEL_83; 3709 goto LABEL_83;
3709 v726 = (Player *)(a2 >> 3); 3710 v726 = (Player *)(a2 >> 3);
3710 HIDWORD(v733) = 836 * (a2 >> 3); 3711 HIDWORD(v733) = 836 * (a2 >> 3);
3711 if ( !stru_50C198.GetMagicalResistance((Actor *)((char *)pActors + HIDWORD(v733)), 3u) ) 3712 if ( !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u) )
3712 goto LABEL_1056; 3713 goto LABEL_1056;
3713 ((SpellBuff *)((char *)&pActors[0].pActorBuffs[10] + HIDWORD(v733)))->Apply( 3714 pActors[a2 >> 3].pActorBuffs[10].Apply(
3714 pMiscTimer->uTotalGameTimeElapsed + 128, 3715 pMiscTimer->uTotalGameTimeElapsed + 128,
3715 v1, 3716 v1,
3716 v1, 3717 v1,
3717 v1, 3718 v1,
3718 v1); 3719 v1);
3896 LODWORD(v733) = v57; 3897 LODWORD(v733) = v57;
3897 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 3898 if ( !pPlayer->CanCastSpell(uRequiredMana) )
3898 goto LABEL_83; 3899 goto LABEL_83;
3899 if ( (a2 & 7) != 3 3900 if ( (a2 & 7) != 3
3900 || (v721 = 836 * (a2 >> 3), 3901 || (v721 = 836 * (a2 >> 3),
3901 LODWORD(v718) = (int)(char *)pActors + v721, 3902 LODWORD(v718) = (int)&pActors[a2 >> 3],
3902 !stru_50C198.GetMagicalResistance((Actor *)((char *)pActors + v721), 3u)) ) 3903 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u)) )
3903 goto LABEL_1056; 3904 goto LABEL_1056;
3904 v726 = (Player *)(23040 * v2); 3905 v726 = (Player *)(23040 * v2);
3905 v58 = (signed __int64)((double)(23040 * v2) * 0.033333335); 3906 v58 = (signed __int64)((double)(23040 * v2) * 0.033333335);
3906 v59 = v721; 3907 v59 = v721;
3907 ((SpellBuff *)((char *)&pActors[0].pActorBuffs[7] + v721))->Apply( 3908 ((SpellBuff *)((char *)&pActors[0].pActorBuffs[7] + v721))->Apply(
3916 goto LABEL_165; 3917 goto LABEL_165;
3917 case 60: 3918 case 60:
3918 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 3919 if ( !pPlayer->CanCastSpell(uRequiredMana) )
3919 goto LABEL_83; 3920 goto LABEL_83;
3920 v730 = 836 * (a2 >> 3); 3921 v730 = 836 * (a2 >> 3);
3921 if ( !stru_50C198.GetMagicalResistance((Actor *)((char *)pActors + v730), 7u) ) 3922 if ( !stru_50C198.GetMagicalResistance(&pActors[a2>>3], 7u) )
3922 goto LABEL_1056; 3923 goto LABEL_1056;
3923 LODWORD(v733) = 300 * v2; 3924 LODWORD(v733) = 300 * v2;
3924 if ( v731 == 2 ) 3925 if ( v731 == 2 )
3925 { 3926 {
3926 LODWORD(v733) = 600 * v2; 3927 LODWORD(v733) = 600 * v2;
3942 a1.stru_24.Reset(); 3943 a1.stru_24.Reset();
3943 a1.field_48 = v3->spellnum; 3944 a1.field_48 = v3->spellnum;
3944 a1.field_4C = v2; 3945 a1.field_4C = v2;
3945 a1.field_50 = v731; 3946 a1.field_50 = v731;
3946 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); 3947 v60 = pObjectList->ObjectIDByItemID(a1.uItemType);
3947 v61 = v730; 3948 v61 = a2 >> 3;
3948 goto LABEL_1086; 3949 goto LABEL_1086;
3949 case 92: 3950 case 92:
3950 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 3951 if ( !pPlayer->CanCastSpell(uRequiredMana) )
3951 goto LABEL_83; 3952 goto LABEL_83;
3952 a1.stru_24.Reset(); 3953 a1.stru_24.Reset();
6305 if ( (a2 & 7) != 3 ) 6306 if ( (a2 & 7) != 3 )
6306 goto LABEL_1056; 6307 goto LABEL_1056;
6307 v730 = 836 * v426; 6308 v730 = 836 * v426;
6308 if ( stru_50C198.GetMagicalResistance(&pActors[v426], 7u) ) 6309 if ( stru_50C198.GetMagicalResistance(&pActors[v426], 7u) )
6309 { 6310 {
6310 ((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Reset(); 6311 pActors[v426].pActorBuffs[1].Reset();
6311 ((SpellBuff *)((char *)&pActors[0].pActorBuffs[12] + v730))->Reset(); 6312 pActors[v426].pActorBuffs[12].Reset();
6312 v732 = amount << 7; 6313 v732 = amount << 7;
6313 ((SpellBuff *)((char *)&pActors[0].pActorBuffs[9] + v730))->Apply( 6314 pActors[v426].pActorBuffs[9].Apply(
6314 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), 6315 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335),
6315 v731, 6316 v731,
6316 v1, 6317 v1,
6317 v1, 6318 v1,
6318 v1); 6319 v1);
6319 *(&pActors[0].pMonsterInfo.uHostilityType + v730) = MonsterInfo::Hostility_Long; 6320 pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
6320 } 6321 }
6321 a1.stru_24.Reset(); 6322 a1.stru_24.Reset();
6322 a1.field_48 = v3->spellnum; 6323 a1.field_48 = v3->spellnum;
6323 a1.field_4C = v2; 6324 a1.field_4C = v2;
6324 a1.field_50 = v731; 6325 a1.field_50 = v731;
6325 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); 6326 v60 = pObjectList->ObjectIDByItemID(a1.uItemType);
6326 v61 = v730; 6327 v61 = v426;
6327 goto LABEL_1086; 6328 goto LABEL_1086;
6328 case 66: 6329 case 66:
6329 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 6330 if ( !pPlayer->CanCastSpell(uRequiredMana) )
6330 goto LABEL_83; 6331 goto LABEL_83;
6331 amount = 600 * v2; 6332 amount = 600 * v2;
6333 if ( (a2 & 7) != 3 ) 6334 if ( (a2 & 7) != 3 )
6334 goto LABEL_1056; 6335 goto LABEL_1056;
6335 v730 = 836 * v427; 6336 v730 = 836 * v427;
6336 if ( MonsterStats::BelongsToSupertype(pActors[v427].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) 6337 if ( MonsterStats::BelongsToSupertype(pActors[v427].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
6337 goto LABEL_83; 6338 goto LABEL_83;
6338 if ( stru_50C198.GetMagicalResistance((Actor *)((char *)pActors + v730), 7u) ) 6339 if ( stru_50C198.GetMagicalResistance(&pActors[v427], 7u) )
6339 { 6340 {
6340 ((SpellBuff *)((char *)&pActors[0].pActorBuffs[9] + v730))->Reset(); 6341 pActors[v427].pActorBuffs[9].Reset();
6341 ((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Reset(); 6342 pActors[v427].pActorBuffs[1].Reset();
6342 v732 = amount << 7; 6343 v732 = amount << 7;
6343 ((SpellBuff *)((char *)&pActors[0].pActorBuffs[12] + v730))->Apply( 6344 pActors[v427].pActorBuffs[12].Apply(
6344 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), 6345 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335),
6345 v731, 6346 v731,
6346 v1, 6347 v1,
6347 v1, 6348 v1,
6348 v1); 6349 v1);
6350 a1.stru_24.Reset(); 6351 a1.stru_24.Reset();
6351 a1.field_48 = v3->spellnum; 6352 a1.field_48 = v3->spellnum;
6352 a1.field_4C = v2; 6353 a1.field_4C = v2;
6353 a1.field_50 = v731; 6354 a1.field_50 = v731;
6354 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); 6355 v60 = pObjectList->ObjectIDByItemID(a1.uItemType);
6355 v61 = v730; 6356 v61 = v427;
6356 goto LABEL_1086; 6357 goto LABEL_1086;
6357 case 63: 6358 case 63:
6358 v428 = v12 - 2; 6359 v428 = v12 - 2;
6359 if ( v428 && (v429 = v428 - 1) != 0 && v429 == 1 ) 6360 if ( v428 && (v429 = v428 - 1) != 0 && v429 == 1 )
6360 v430 = 300 * v2; 6361 v430 = 300 * v2;
6914 v733 = __PAIR__(v1, v516); 6915 v733 = __PAIR__(v1, v516);
6915 v517 = 8 * v3->uPlayerID; 6916 v517 = 8 * v3->uPlayerID;
6916 LOBYTE(v517) = v517 | 4; 6917 LOBYTE(v517) = v517 | 4;
6917 if ( (signed int)uNumActors > v1 ) 6918 if ( (signed int)uNumActors > v1 )
6918 { 6919 {
6919 v518 = (char *)&pActors[0].uAIState; 6920 v518 = pActors;//[0].uAIState;
6920 v726 = (Player *)uNumActors; 6921 v726b = uNumActors;
6921 do 6922 do
6922 { 6923 {
6923 v519 = *(short *)v518; 6924 v519 = v518->uAIState;
6924 if ( *(short *)v518 != 5 && v519 != 11 && v519 != 19 && v517 == *((int *)v518 + 159) ) 6925 if ( v518->uAIState != 5 && v519 != 11 && v519 != 19 && v517 == v518->uSummonerID )
6925 ++HIDWORD(v733); 6926 ++HIDWORD(v733);
6926 v518 += 836; 6927 ++v518;
6927 v726 = (Player *)((char *)v726 - 1); 6928 --v726;
6928 } 6929 }
6929 while ( *(float *)&v726 != 0.0 ); 6930 while ( v726 != 0 );
6930 } 6931 }
6931 if ( SHIDWORD(v733) >= amount ) 6932 if ( SHIDWORD(v733) >= amount )
6932 { 6933 {
6933 v66 = pGlobalTXT_LocalizationStrings[648]; 6934 v66 = pGlobalTXT_LocalizationStrings[648];
6934 goto LABEL_201; 6935 goto LABEL_201;
7435 if ( (a2 & 7) != 3 ) 7436 if ( (a2 & 7) != 3 )
7436 goto LABEL_1056; 7437 goto LABEL_1056;
7437 v730 = 836 * v599; 7438 v730 = 836 * v599;
7438 if ( !MonsterStats::BelongsToSupertype(pActors[v599].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) 7439 if ( !MonsterStats::BelongsToSupertype(pActors[v599].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
7439 goto LABEL_83; 7440 goto LABEL_83;
7440 if ( !stru_50C198.GetMagicalResistance((Actor *)((char *)pActors + v730), 0xAu) ) 7441 if ( !stru_50C198.GetMagicalResistance(&pActors[v599], 0xAu) )
7441 goto LABEL_200; 7442 goto LABEL_200;
7442 ((SpellBuff *)((char *)&pActors[0].pActorBuffs[9] + v730))->Reset(); 7443 pActors[v599].pActorBuffs[9].Reset();
7443 ((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Reset(); 7444 pActors[v599].pActorBuffs[1].Reset();
7444 v732 = (int)v733 << 7; 7445 v732 = (int)v733 << 7;
7445 ((SpellBuff *)((char *)&pActors[0].pActorBuffs[12] + v730))->Apply( 7446 pActors[v599].pActorBuffs[12].Apply(
7446 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), 7447 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335),
7447 v731, 7448 v731,
7448 v1, 7449 v1,
7449 v1, 7450 v1,
7450 v1); 7451 v1);
7451 a1.stru_24.Reset(); 7452 a1.stru_24.Reset();
7452 a1.field_48 = v3->spellnum; 7453 a1.field_48 = v3->spellnum;
7453 a1.field_4C = v2; 7454 a1.field_4C = v2;
7454 a1.field_50 = v731; 7455 a1.field_50 = v731;
7455 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); 7456 v60 = pObjectList->ObjectIDByItemID(a1.uItemType);
7456 v61 = v730; 7457 v61 = v599;
7457 LABEL_1086: 7458 LABEL_1086:
7458 v600 = *(__int16 *)((char *)&pActors[0].vPosition.y + v61); 7459 v600 = pActors[v61].vPosition.y;
7459 v601 = *(__int16 *)((char *)&pActors[0].vPosition.x + v61); 7460 v601 = pActors[v61].vPosition.x;
7460 a1.uObjectDescID = v60; 7461 a1.uObjectDescID = v60;
7461 a1.vPosition.x = v601; 7462 a1.vPosition.x = v601;
7462 v602 = *(unsigned __int16 *)((char *)&pActors[0].uActorHeight + v61); 7463 v602 = pActors[v61].uActorHeight;
7463 v603 = *(__int16 *)((char *)&pActors[0].vPosition.z + v61); 7464 v603 = pActors[v61].vPosition.z;
7464 a1.vPosition.y = v600; 7465 a1.vPosition.y = v600;
7465 v676 = v603 + v602; 7466 v676 = v603 + v602;
7466 v665 = v600; 7467 v665 = v600;
7467 a1.vPosition.z = v603 + v602; 7468 a1.vPosition.z = v603 + v602;
7468 v657 = v601; 7469 v657 = v601;