Mercurial > mm7
diff mm7_2.cpp @ 574:f90753ebabe3
Merge
author | Nomad |
---|---|
date | Wed, 06 Mar 2013 06:41:36 +0200 |
parents | 7c0763248a87 cdf3afa8db74 |
children | 9e80b6e1b155 42d5777c2f47 |
line wrap: on
line diff
--- a/mm7_2.cpp Wed Mar 06 06:41:05 2013 +0200 +++ b/mm7_2.cpp Wed Mar 06 06:41:36 2013 +0200 @@ -13400,7 +13400,7 @@ assert(sizeof(stru176) == 0x20); assert(sizeof(SavegameHeader) == 0x64); assert(sizeof(SavegameList) == 0x3138); - assert(sizeof(StorylineText) == 0x168); + assert(sizeof(StorylineText) == 0x160); assert(sizeof(FactionTable) == 0x1EF1); assert(sizeof(Decal) == 0xC20); assert(sizeof(DecalBuilder) == 0x30C038); @@ -14656,16 +14656,13 @@ { if ( v2 ) { -LABEL_7: LOBYTE(v5) = v0->GetActualSkillLevel(PLAYER_SKILL_SPEAR); if ( (signed int)SkillToMastery(v5) < 3 ) { -LABEL_8: v0->PlaySound(SPEECH_39, 0); return; } v3 = pParty->pPickedItem.uItemID; - goto LABEL_16; } } else @@ -14673,11 +14670,21 @@ if ( (v4 == 8 || v4 == 1 || v4 == 2) && v1 && pItemsTable->pItems[*(int *)&v0->pInventoryItems[v1-1]].uSkillType == 4 ) - goto LABEL_7; - } -LABEL_16: + { + LOBYTE(v5) = v0->GetActualSkillLevel(PLAYER_SKILL_SPEAR); + if ( (signed int)SkillToMastery(v5) < 3 ) + { + v0->PlaySound(SPEECH_39, 0); + return; + } + } + } if ( !v0->CanEquip_RaceAndAlignmentCheck(v3) ) - goto LABEL_8; + { + + v0->PlaySound(SPEECH_39, 0); + return; + } if ( pParty->pPickedItem.uItemID == 604 ) { sub_467E7F_EquipBody(3u); @@ -14696,16 +14703,39 @@ case 9u: case 0xBu: if ( !v0->HasSkill(v4) ) - goto LABEL_8; + { + v0->PlaySound(SPEECH_39, 0); + return; + } if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) && (v6 != 3 || bUnderwater) ) - goto LABEL_95; + { + v46 = 0; + v45 = 0; + v44 = 0; + v43 = 0; + v42 = -1; + v41 = 0; + v40 = 0; + pAudioPlayer->PlaySound(SOUND_27, v40, v41, v42, v43, v44, v45, v46); + return; + } sub_467E7F_EquipBody(v6); if ( pParty->pPickedItem.uItemID == 604 ) WetsuitOff(uActiveCharacter); return; case 0xAu: if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) ) - goto LABEL_95; + { + v46 = 0; + v45 = 0; + v44 = 0; + v43 = 0; + v42 = -1; + v41 = 0; + v40 = 0; + pAudioPlayer->PlaySound(SOUND_27, v40, v41, v42, v43, v44, v45, v46); + return; + } v52 = 10; v7 = (int)&v0->pEquipment.field_28; while ( 1 ) @@ -14714,19 +14744,20 @@ { v8 = v0->FindFreeInventorySlot(); if ( (v8 & 0x80000000u) == 0 ) + { + v9 = v52; + pParty->pPickedItem.uBodyAnchor = v52 + 1; + memcpy(&v0->pInventoryItems[v8], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v8])); + *(&v0->pEquipment.uOffHand + v9) = v8 + 1; + pMouse->RemoveHoldingItem(); break; + } } ++v52; v7 += 4; if ( (signed int)v52 > 15 ) - goto LABEL_33; - } - v9 = v52; - pParty->pPickedItem.uBodyAnchor = v52 + 1; - memcpy(&v0->pInventoryItems[v8], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v8])); - *(&v0->pEquipment.uOffHand + v9) = v8 + 1; - pMouse->RemoveHoldingItem(); -LABEL_33: + break; + } if ( v52 == 16 ) { v52 = v0->pEquipment.field_3C - 1; @@ -14743,9 +14774,22 @@ return; case 4u: if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) ) - goto LABEL_95; + { + v46 = 0; + v45 = 0; + v44 = 0; + v43 = 0; + v42 = -1; + v41 = 0; + v40 = 0; + pAudioPlayer->PlaySound(SOUND_27, v40, v41, v42, v43, v44, v45, v46); + return; + } if ( !v0->HasSkill(v4) ) - goto LABEL_8; + { + v0->PlaySound(SPEECH_39, 0); + return; + } if ( v54 ) { --v54; @@ -14773,7 +14817,8 @@ v17 = v52 + 1; memcpy(&v0->pInventoryItems[v52], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v52])); v0->pEquipment.uOffHand = v17; - goto LABEL_45; + pMouse->RemoveHoldingItem(); + return; } memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); v15 = (int)((char *)v0 + 36 * (v53 - 1)); @@ -14792,9 +14837,22 @@ if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) && pParty->pPickedItem.uItemID != 64 && pParty->pPickedItem.uItemID != 65 ) - goto LABEL_95; + { + v46 = 0; + v45 = 0; + v44 = 0; + v43 = 0; + v42 = -1; + v41 = 0; + v40 = 0; + pAudioPlayer->PlaySound(SOUND_27, v40, v41, v42, v43, v44, v45, v46); + return; + } if ( !v0->HasSkill(v4) ) - goto LABEL_8; + { + v0->PlaySound(SPEECH_39, 0); + return; + } v50 = 0; if ( v4 == 2 && (unsigned __int16)(v0->pActiveSkills[2] & 0xFFC0) || v4 == 1 && (signed int)SkillToMastery(v0->pActiveSkills[1]) >= 3 ) @@ -14830,9 +14888,12 @@ if ( !v14 ) return; v22 = _this.uItemID; -LABEL_73: v50 = v22; - goto LABEL_74; + if ( v50 ) + stru_A750F8[uActiveCharacter - 1]._494836( + *((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), + uActiveCharacter - 1 + 9); + break; } v23 = v0->FindFreeInventorySlot(); if ( (v23 & 0x80000000u) != 0 ) @@ -14841,12 +14902,16 @@ v50 = (unsigned int)&v0->pInventoryItems[v23]; memcpy(&v0->pInventoryItems[v23], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v23])); v0->pEquipment.uOffHand = v23 + 1; -LABEL_71: pMouse->RemoveHoldingItem(); if ( v52 != 12 ) return; v22 = *(int *)v50; - goto LABEL_73; + v50 = v22; + if ( v50 ) + stru_A750F8[uActiveCharacter - 1]._494836( + *((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), + uActiveCharacter - 1 + 9); + break; } } } @@ -14859,7 +14924,16 @@ v50 = (unsigned int)&v0->pInventoryItems[v26]; memcpy(&v0->pInventoryItems[v26], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v26])); v0->pEquipment.uMainHand = v26 + 1; - goto LABEL_71; + pMouse->RemoveHoldingItem(); + if ( v52 != 12 ) + return; + v22 = *(int *)v50; + v50 = v22; + if ( v50 ) + stru_A750F8[uActiveCharacter - 1]._494836( + *((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), + uActiveCharacter - 1 + 9); + break; } --v53; memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); @@ -14876,7 +14950,6 @@ v50 = _this.uItemID; if ( v51 ) v0->pEquipment.uOffHand = 0; -LABEL_74: if ( v50 ) stru_A750F8[uActiveCharacter - 1]._494836( *((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), @@ -14884,9 +14957,22 @@ break; case 1u: if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) ) - goto LABEL_95; + { + v46 = 0; + v45 = 0; + v44 = 0; + v43 = 0; + v42 = -1; + v41 = 0; + v40 = 0; + pAudioPlayer->PlaySound(SOUND_27, v40, v41, v42, v43, v44, v45, v46); + return; + } if ( !v0->HasSkill(v4) ) - goto LABEL_8; + { + v0->PlaySound(SPEECH_39, 0); + return; + } if ( v53 ) { if ( v54 ) @@ -14898,7 +14984,8 @@ v42 = -1; v41 = 0; v40 = 0; - goto LABEL_96; + pAudioPlayer->PlaySound(SOUND_27, v40, v41, v42, v43, v44, v45, v46); + return; } --v53; memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); @@ -14935,7 +15022,6 @@ v31 = v52 + 1; memcpy(&v0->pInventoryItems[v52], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v52])); v0->pEquipment.uMainHand = v31; -LABEL_45: pMouse->RemoveHoldingItem(); } } @@ -14972,7 +15058,6 @@ { if ( bUnderwater ) { -LABEL_95: v46 = 0; v45 = 0; v44 = 0; @@ -14980,7 +15065,6 @@ v42 = -1; v41 = 0; v40 = 0; -LABEL_96: pAudioPlayer->PlaySound(SOUND_27, v40, v41, v42, v43, v44, v45, v46); return; } @@ -15105,71 +15189,75 @@ } v22 = 0; v1 = (int *)((signed int)(viewparams->uScreenZ + viewparams->uScreenX) >> 1); - if ( (signed int)viewparams->uScreenY >= (signed int)viewparams->uScreenW ) - goto LABEL_21; - v2 = (char *)v1 - 50; - v1 = (int *)((char *)v1 + 50); - v3 = 640 * viewparams->uScreenY; - v17 = v2; - v20 = v1; - v18 = ((viewparams->uScreenW - viewparams->uScreenY - 1) >> 1) + 1; - do - { - if ( (signed int)v2 >= (signed int)v20 ) - goto LABEL_20; - v1 = &pRenderer->pActiveZBuffer[(int)&v2[v3]]; - v21 = &pRenderer->pActiveZBuffer[(int)&v2[v3]]; - v4 = v22; - v5 = (((char *)v20 - v2 - 1) >> 1) + 1; - do - { - v6 = 0; - v7 = *v1 & 0xFFFF; - v19 = 0; - if ( v4 > 0 ) - { - do - { - if ( dword_7207F0[v6] == v7 ) - break; - ++v6; - v19 = v6; - } - while ( v6 < v22 ); - } - if ( (v7 & 7) == OBJECT_Decoration) - { - v16 = (unsigned int)v7 >> 3; - if ( (signed int)(((unsigned int)*v21 >> 16) - - pDecorationList->pDecorations[pLevelDecorations[(unsigned int)v7 >> 3].uDecorationDescID].uRadius) > 512 ) - goto LABEL_18; - } - else - { - if ( (unsigned int)*v21 > 0x2000000 ) - goto LABEL_18; - } - if ( v19 == v22 && v4 < 100 ) - { - ++v22; - ++v4; - v8 = *v21; - dword_7207EC[v4] = v7; - dword_72065C[v4] = v8; - } -LABEL_18: - v1 = v21 + 2; - --v5; - v21 += 2; - } - while ( v5 ); - v2 = v17; -LABEL_20: - v3 += 1280; - --v18; - } - while ( v18 ); -LABEL_21: + if ( (signed int)viewparams->uScreenY < (signed int)viewparams->uScreenW ) + { + v2 = (char *)v1 - 50; + v1 = (int *)((char *)v1 + 50); + v3 = 640 * viewparams->uScreenY; + v17 = v2; + v20 = v1; + v18 = ((viewparams->uScreenW - viewparams->uScreenY - 1) >> 1) + 1; + do + { + if ( (signed int)v2 < (signed int)v20 ) + { + v1 = &pRenderer->pActiveZBuffer[(int)&v2[v3]]; + v21 = &pRenderer->pActiveZBuffer[(int)&v2[v3]]; + v4 = v22; + v5 = (((char *)v20 - v2 - 1) >> 1) + 1; + do + { + v6 = 0; + v7 = *v1 & 0xFFFF; + v19 = 0; + if ( v4 > 0 ) + { + do + { + if ( dword_7207F0[v6] == v7 ) + break; + ++v6; + v19 = v6; + } + while ( v6 < v22 ); + } + if ( (v7 & 7) == OBJECT_Decoration) + { + v16 = (unsigned int)v7 >> 3; + if ( (signed int)(((unsigned int)*v21 >> 16) + - pDecorationList->pDecorations[pLevelDecorations[(unsigned int)v7 >> 3].uDecorationDescID].uRadius) <= 512 ) + if ( v19 == v22 && v4 < 100 ) + { + ++v22; + ++v4; + v8 = *v21; + dword_7207EC[v4] = v7; + dword_72065C[v4] = v8; + } + } + else if ( (unsigned int)*v21 <= 0x2000000 ) + { + if ( v19 == v22 && v4 < 100 ) + { + ++v22; + ++v4; + v8 = *v21; + dword_7207EC[v4] = v7; + dword_72065C[v4] = v8; + } + } + v1 = v21 + 2; + --v5; + v21 += 2; + } + while ( v5 ); + v2 = v17; + } + v3 += 1280; + --v18; + } + while ( v18 ); + } if ( v22 > 0 ) { v9 = dword_720660; @@ -15344,7 +15432,6 @@ || (v7 = &pOutdoor->pBModels[a1 >> 9].pFaces[(a1 >> 3) & 0x3F], BYTE2(v7->uAttributes) & 0x10) || (v6 = v7->sCogTriggeredID) == 0 ) return 1; -LABEL_13: EventProcessor((signed __int16)v6, v2, 1); return 0; } @@ -15358,7 +15445,10 @@ if ( v5 & 0x100000 || (v6 = pIndoor->pFaceExtras[v4->uFaceExtraID].uEventID) == 0 ) return 1; if ( pCurrentScreen != SCREEN_BRANCHLESS_NPC_DIALOG ) - goto LABEL_13; + { + EventProcessor((signed __int16)v6, v2, 1); + return 0; + } break; } return 0;