Mercurial > mm7
comparison mm7_2.cpp @ 141:cca78efb377e
Constants -> enums
author | Nomad |
---|---|
date | Tue, 12 Feb 2013 03:02:13 +0200 |
parents | 9b0d651821f1 |
children | d92c78ab54fe ee11772d0ad2 |
comparison
equal
deleted
inserted
replaced
140:f4d7a9a8c363 | 141:cca78efb377e |
---|---|
3247 v1 = pActors;//[0].uAIState; | 3247 v1 = pActors;//[0].uAIState; |
3248 v7 = uNumActors; | 3248 v7 = uNumActors; |
3249 do | 3249 do |
3250 { | 3250 { |
3251 v2 = v1->uAIState; | 3251 v2 = v1->uAIState; |
3252 if ( v1->uAIState == 5 || v2 == 11 || v2 == 19 || (v3 = v1->uSummonerID) != 0 && (v3 & 7) == 4 ) | 3252 if ( v1->uAIState == Dead || v2 == Removed || v2 == Disabled || (v3 = v1->uSummonerID) != 0 && (v3 & 7) == OBJECT_Player) |
3253 ++v0; | 3253 ++v0; |
3254 ++v1; | 3254 ++v1; |
3255 --v7; | 3255 --v7; |
3256 } | 3256 } |
3257 while ( v7 ); | 3257 while ( v7 ); |
15595 ++v6; | 15595 ++v6; |
15596 v19 = v6; | 15596 v19 = v6; |
15597 } | 15597 } |
15598 while ( v6 < v22 ); | 15598 while ( v6 < v22 ); |
15599 } | 15599 } |
15600 if ( (v7 & 7) == 5 ) | 15600 if ( (v7 & 7) == OBJECT_Decoration) |
15601 { | 15601 { |
15602 v16 = (unsigned int)v7 >> 3; | 15602 v16 = (unsigned int)v7 >> 3; |
15603 if ( (signed int)(((unsigned int)*v21 >> 16) | 15603 if ( (signed int)(((unsigned int)*v21 >> 16) |
15604 - pDecorationList->pDecorations[pLevelDecorations[(unsigned int)v7 >> 3].uDecorationDescID].uRadius) > 512 ) | 15604 - pDecorationList->pDecorations[pLevelDecorations[(unsigned int)v7 >> 3].uDecorationDescID].uRadius) > 512 ) |
15605 goto LABEL_18; | 15605 goto LABEL_18; |
15694 | 15694 |
15695 v26 = a2; | 15695 v26 = a2; |
15696 v2 = a1; | 15696 v2 = a1; |
15697 switch ( a1 & 7 ) | 15697 switch ( a1 & 7 ) |
15698 { | 15698 { |
15699 case 2: | 15699 case OBJECT_Item: |
15700 v17 = a1 >> 3; | 15700 v17 = a1 >> 3; |
15701 v26 = a1 >> 3; | 15701 v26 = a1 >> 3; |
15702 v18 = a1 >> 3; | 15702 v18 = a1 >> 3; |
15703 if ( pObjectList->pObjects[pLayingItems[v18].uObjectDescID].uFlags & 0x10 | 15703 if ( pObjectList->pObjects[pLayingItems[v18].uObjectDescID].uFlags & 0x10 |
15704 || v17 >= 1000 | 15704 || v17 >= 1000 |
15727 pParty->SetHoldingItem(v19); | 15727 pParty->SetHoldingItem(v19); |
15728 v21 = v26; | 15728 v21 = v26; |
15729 } | 15729 } |
15730 LayingItem::_42F933(v21); | 15730 LayingItem::_42F933(v21); |
15731 break; | 15731 break; |
15732 case 3: | 15732 |
15733 case OBJECT_Actor: | |
15733 v12 = a1 >> 3; | 15734 v12 = a1 >> 3; |
15734 v13 = &pActors[a1 >> 3]; | 15735 v13 = &pActors[a1 >> 3]; |
15735 v14 = v13->uAIState; | 15736 v14 = v13->uAIState; |
15736 if ( v14 == 4 || v14 == 17 ) | 15737 if ( v14 == 4 || v14 == 17 ) |
15737 return 1; | 15738 return 1; |
15769 } | 15770 } |
15770 } | 15771 } |
15771 } | 15772 } |
15772 } | 15773 } |
15773 break; | 15774 break; |
15774 case 5: | 15775 |
15776 case OBJECT_Decoration: | |
15775 v8 = &pLevelDecorations[a1 >> 3]; | 15777 v8 = &pLevelDecorations[a1 >> 3]; |
15776 v9 = v8->field_16_event_id; | 15778 v9 = v8->field_16_event_id; |
15777 if ( v9 ) | 15779 if ( v9 ) |
15778 { | 15780 { |
15779 EventProcessor(v9, a1, 1); | 15781 EventProcessor(v9, a1, 1); |
15789 _5C3420_pDecoration = v8; | 15791 _5C3420_pDecoration = v8; |
15790 EventProcessor(v11, 0, 1); | 15792 EventProcessor(v11, 0, 1); |
15791 _5C3420_pDecoration = 0; | 15793 _5C3420_pDecoration = 0; |
15792 } | 15794 } |
15793 break; | 15795 break; |
15796 | |
15794 default: | 15797 default: |
15795 if ( (a1 & 7) != 6 ) | 15798 if ( (a1 & 7) != OBJECT_BModel) |
15796 { | 15799 { |
15797 MessageBoxW(nullptr, L"Warning: Invalid ID reached!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Mouse.cpp:2020", 0); | 15800 MessageBoxW(nullptr, L"Warning: Invalid ID reached!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Mouse.cpp:2020", 0); |
15798 return 1; | 15801 return 1; |
15799 } | 15802 } |
15800 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor ) | 15803 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor ) |
15801 { | 15804 { |
15802 if ( a1 >> 9 >= pOutdoor->uNumBModels | 15805 if ( a1 >> 9 >= pOutdoor->uNumBModels |
15863 { | 15866 { |
15864 v5 = v15; | 15867 v5 = v15; |
15865 v6 = ((v12 - v4 - 1) >> 1) + 1; | 15868 v6 = ((v12 - v4 - 1) >> 1) + 1; |
15866 do | 15869 do |
15867 { | 15870 { |
15868 if ( (*(char *)v5 & 7) == 3 ) | 15871 if ( (*(char *)v5 & 7) == OBJECT_Actor) |
15869 { | 15872 { |
15870 if ( *v5 <= a3 << 16 ) | 15873 if ( *v5 <= a3 << 16 ) |
15871 { | 15874 { |
15872 v7 = (signed int)(unsigned __int16)*v5 >> 3; | 15875 v7 = (signed int)(unsigned __int16)*v5 >> 3; |
15873 v8 = pActors[v7].uAIState; | 15876 v8 = pActors[v7].uAIState; |
15934 do | 15937 do |
15935 { | 15938 { |
15936 v3 = pRenderer->GetParentBillboardID(a1a); | 15939 v3 = pRenderer->GetParentBillboardID(a1a); |
15937 v4 = pBillboardRenderList[v3].sZValue; | 15940 v4 = pBillboardRenderList[v3].sZValue; |
15938 v5 = (unsigned __int16)pBillboardRenderList[v3].sZValue; | 15941 v5 = (unsigned __int16)pBillboardRenderList[v3].sZValue; |
15939 if ( (v5 & 7) == 3 ) | 15942 if ( (v5 & 7) == OBJECT_Actor) |
15940 { | 15943 { |
15941 if ( v4 <= (unsigned int)(a3 << 16) ) | 15944 if ( v4 <= (unsigned int)(a3 << 16) ) |
15942 { | 15945 { |
15943 v6 = v5 >> 3; | 15946 v6 = v5 >> 3; |
15944 v7 = v6; | 15947 v7 = v6; |
16193 return 0; | 16196 return 0; |
16194 while ( 1 ) | 16197 while ( 1 ) |
16195 { | 16198 { |
16196 v19 = dword_720020_zvalues[v18] & 0xFFFF; | 16199 v19 = dword_720020_zvalues[v18] & 0xFFFF; |
16197 v20 = (dword_720020_zvalues[v18] & 0xFFFFu) >> 3; | 16200 v20 = (dword_720020_zvalues[v18] & 0xFFFFu) >> 3; |
16198 if ( (dword_720020_zvalues[v18] & 7) == 2 ) | 16201 if ( (dword_720020_zvalues[v18] & 7) == OBJECT_Item) |
16199 { | 16202 { |
16200 if ( v20 >= 0x3E8 ) | 16203 if ( v20 >= 0x3E8 ) |
16201 return 0; | 16204 return 0; |
16202 if ( !(pLayingItems[v20].uAttributes & 0x10) ) | 16205 if ( !(pLayingItems[v20].uAttributes & 0x10) ) |
16203 { | 16206 { |
16206 v24 = v23; | 16209 v24 = v23; |
16207 goto LABEL_51; | 16210 goto LABEL_51; |
16208 } | 16211 } |
16209 goto LABEL_41; | 16212 goto LABEL_41; |
16210 } | 16213 } |
16211 if ( (dword_720020_zvalues[v18] & 7) == 3 ) | 16214 if ( (dword_720020_zvalues[v18] & 7) == OBJECT_Actor) |
16212 { | 16215 { |
16213 if ( v20 >= 0xBB8 ) | 16216 if ( v20 >= 0xBB8 ) |
16214 return 0; | 16217 return 0; |
16215 v24 = (const char *)&pActors[v20]; | 16218 v24 = (const char *)&pActors[v20]; |
16216 goto LABEL_51; | 16219 goto LABEL_51; |
16217 } | 16220 } |
16218 if ( (dword_720020_zvalues[v18] & 7) == 5 ) | 16221 if ( (dword_720020_zvalues[v18] & 7) == OBJECT_Decoration) |
16219 break; | 16222 break; |
16220 if ( (dword_720020_zvalues[v18] & 7) == 6 ) | 16223 if ( (dword_720020_zvalues[v18] & 7) == OBJECT_BModel) |
16221 { | 16224 { |
16222 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) | 16225 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) |
16223 { | 16226 { |
16224 v21 = &pIndoor->pFaces[v20]; | 16227 v21 = &pIndoor->pFaces[v20]; |
16225 if ( !(BYTE3(v21->uAttributes) & 2) ) | 16228 if ( !(BYTE3(v21->uAttributes) & 2) ) |
16547 v153 = uLayingItemID; | 16550 v153 = uLayingItemID; |
16548 v2 = &pLayingItems[uLayingItemID]; | 16551 v2 = &pLayingItems[uLayingItemID]; |
16549 v3 = &pObjectList->pObjects[v2->uObjectDescID]; | 16552 v3 = &pObjectList->pObjects[v2->uObjectDescID]; |
16550 v145 = a2; | 16553 v145 = a2; |
16551 v151 = a2 & 7; | 16554 v151 = a2 & 7; |
16552 if ( (a2 & 7) == 3 ) | 16555 if ( (a2 & 7) == OBJECT_Actor) |
16553 { | 16556 { |
16554 if ( (v2->field_58 & 7) == 3 && !pActors[v2->field_58 >> 3].GetActorsRelation(&pActors[a2 >> 3]) ) | 16557 if ( (v2->field_58 & 7) == OBJECT_Actor && !pActors[v2->field_58 >> 3].GetActorsRelation(&pActors[a2 >> 3]) ) |
16555 return 1; | 16558 return 1; |
16556 } | 16559 } |
16557 else | 16560 else |
16558 { | 16561 { |
16559 if ( (a2 & 7) == 4 && (v2->field_58 & 7) == 4 ) | 16562 if ( (a2 & 7) == OBJECT_Player && (v2->field_58 & 7) == OBJECT_Player) |
16560 return 1; | 16563 return 1; |
16561 } | 16564 } |
16562 if ( pParty->bTurnBasedModeOn == 1 ) | 16565 if ( pParty->bTurnBasedModeOn == 1 ) |
16563 { | 16566 { |
16564 v5 = v2->uAttributes; | 16567 v5 = v2->uAttributes; |
16566 { | 16569 { |
16567 --pTurnEngine->field_1C; | 16570 --pTurnEngine->field_1C; |
16568 v2->uAttributes = v5 & 0xFFFB; | 16571 v2->uAttributes = v5 & 0xFFFB; |
16569 } | 16572 } |
16570 } | 16573 } |
16571 if ( v151 == 6 && (v2->field_58 & 7) != 4 ) | 16574 if ( v151 == OBJECT_BModel && (v2->field_58 & 7) != OBJECT_Player) |
16572 BYTE2(pActors[v2->field_58 >> 3].uAttributes) |= 4u; | 16575 BYTE2(pActors[v2->field_58 >> 3].uAttributes) |= 4u; |
16573 v6 = v2->uItemType; | 16576 v6 = v2->uItemType; |
16574 v7 = v2->uItemType; | 16577 v7 = v2->uItemType; |
16575 if ( v7 > 3060 ) | 16578 if ( v7 > 3060 ) |
16576 { | 16579 { |
16623 case 0x2346u: | 16626 case 0x2346u: |
16624 v143 = 18030; | 16627 v143 = 18030; |
16625 break; | 16628 break; |
16626 } | 16629 } |
16627 v138 = 1; | 16630 v138 = 1; |
16628 if ( v151 != 3 ) | 16631 if ( v151 != OBJECT_Actor) |
16629 { | 16632 { |
16630 if ( v6 != 9030 || v2->field_50 != 4 ) | 16633 if ( v6 != 9030 || v2->field_50 != 4 ) |
16631 goto LABEL_246; | 16634 goto LABEL_246; |
16632 v2->_46BEF1_apply_spells(); | 16635 v2->_46BEF1_apply_spells(); |
16633 LABEL_233: | 16636 LABEL_233: |