comparison mm7_2.cpp @ 519:8f70e52646eb

Merge
author Gloval
date Fri, 01 Mar 2013 22:18:22 +0400
parents d2a55c0a8dda cb0ad52d6a26
children 35f28d4c0ff9
comparison
equal deleted inserted replaced
518:9c984eef0a7d 519:8f70e52646eb
19 #include "Allocator.h" 19 #include "Allocator.h"
20 #include "Events.h" 20 #include "Events.h"
21 #include "Viewport.h" 21 #include "Viewport.h"
22 #include "FrameTableInc.h" 22 #include "FrameTableInc.h"
23 #include "Math.h" 23 #include "Math.h"
24 #include "LayingItem.h" 24 #include "SpriteObject.h"
25 #include "ObjectList.h" 25 #include "ObjectList.h"
26 #include "Chest.h" 26 #include "Chest.h"
27 #include "PaletteManager.h" 27 #include "PaletteManager.h"
28 #include "DecorationList.h" 28 #include "DecorationList.h"
29 #include "SaveLoad.h" 29 #include "SaveLoad.h"
7870 unsigned __int16 v26; // ax@33 7870 unsigned __int16 v26; // ax@33
7871 //int v27; // ecx@35 7871 //int v27; // ecx@35
7872 //int v28; // eax@35 7872 //int v28; // eax@35
7873 //int v29; // esi@35 7873 //int v29; // esi@35
7874 //__int16 v30; // ax@35 7874 //__int16 v30; // ax@35
7875 LayingItem a1a; // [sp+Ch] [bp-7Ch]@1 7875 SpriteObject a1a; // [sp+Ch] [bp-7Ch]@1
7876 //int v32; // [sp+7Ch] [bp-Ch]@1 7876 //int v32; // [sp+7Ch] [bp-Ch]@1
7877 //int v33; // [sp+80h] [bp-8h]@1 7877 //int v33; // [sp+80h] [bp-8h]@1
7878 int v34; // [sp+84h] [bp-4h]@1 7878 int v34; // [sp+84h] [bp-4h]@1
7879 7879
7880 //auto a1 = this; 7880 //auto a1 = this;
7930 if ( a2->uIndex != 6 ) 7930 if ( a2->uIndex != 6 )
7931 { 7931 {
7932 LABEL_20: 7932 LABEL_20:
7933 v15 = 0; 7933 v15 = 0;
7934 v16 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID; 7934 v16 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
7935 a1a.uItemType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID; 7935 a1a.uType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
7936 if ( (signed int)pObjectList->uNumObjects <= 0 ) 7936 if ( (signed int)pObjectList->uNumObjects <= 0 )
7937 { 7937 {
7938 LABEL_24: 7938 LABEL_24:
7939 v18 = 0; 7939 v18 = 0;
7940 } 7940 }
7975 result = a1a.stru_24.GenerateArtifact(); 7975 result = a1a.stru_24.GenerateArtifact();
7976 if ( !result ) 7976 if ( !result )
7977 return result; 7977 return result;
7978 v23 = 0; 7978 v23 = 0;
7979 v24 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID; 7979 v24 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
7980 a1a.uItemType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID; 7980 a1a.uType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
7981 if ( (signed int)pObjectList->uNumObjects <= 0 ) 7981 if ( (signed int)pObjectList->uNumObjects <= 0 )
7982 { 7982 {
7983 LABEL_33: 7983 LABEL_33:
7984 v26 = 0; 7984 v26 = 0;
7985 } 7985 }
8023 int v7; // esi@1 8023 int v7; // esi@1
8024 signed int v8; // edi@1 8024 signed int v8; // edi@1
8025 unsigned __int16 v9; // cx@1 8025 unsigned __int16 v9; // cx@1
8026 char *v10; // edx@2 8026 char *v10; // edx@2
8027 unsigned __int16 v11; // ax@5 8027 unsigned __int16 v11; // ax@5
8028 LayingItem a1; // [sp+8h] [bp-70h]@1 8028 SpriteObject a1; // [sp+8h] [bp-70h]@1
8029 8029
8030 v6 = ecx0; 8030 v6 = ecx0;
8031 v7 = a2; 8031 v7 = a2;
8032 pItemsTable->GenerateItem(v6, v7, &a1.stru_24); 8032 pItemsTable->GenerateItem(v6, v7, &a1.stru_24);
8033 v8 = 0; 8033 v8 = 0;
8034 v9 = pItemsTable->pItems[a1.stru_24.uItemID].uSpriteID; 8034 v9 = pItemsTable->pItems[a1.stru_24.uItemID].uSpriteID;
8035 a1.uItemType = pItemsTable->pItems[a1.stru_24.uItemID].uSpriteID; 8035 a1.uType = pItemsTable->pItems[a1.stru_24.uItemID].uSpriteID;
8036 if ( (signed int)pObjectList->uNumObjects <= 0 ) 8036 if ( (signed int)pObjectList->uNumObjects <= 0 )
8037 { 8037 {
8038 LABEL_5: 8038 LABEL_5:
8039 v11 = 0; 8039 v11 = 0;
8040 } 8040 }
12213 _strrev(Str1); 12213 _strrev(Str1);
12214 strtok(Str1, "."); 12214 strtok(Str1, ".");
12215 _strrev(Str1); 12215 _strrev(Str1);
12216 12216
12217 for (uint i = 0; i < 1000; ++i) 12217 for (uint i = 0; i < 1000; ++i)
12218 pLayingItems[i].uObjectDescID = 0; 12218 pSpriteObjects[i].uObjectDescID = 0;
12219 12219
12220 v5 = pMapStats->GetMapInfo(pCurrentMapName); 12220 v5 = pMapStats->GetMapInfo(pCurrentMapName);
12221 bUnderwater = 0; 12221 bUnderwater = 0;
12222 uLevelMapStatsID = v5; 12222 uLevelMapStatsID = v5;
12223 pGame->uFlags2 &= 0xFFFFFFF7u; 12223 pGame->uFlags2 &= 0xFFFFFFF7u;
14937 { 14937 {
14938 case OBJECT_Item: // take the item 14938 case OBJECT_Item: // take the item
14939 v17 = a1 >> 3; 14939 v17 = a1 >> 3;
14940 v26 = a1 >> 3; 14940 v26 = a1 >> 3;
14941 v18 = a1 >> 3; 14941 v18 = a1 >> 3;
14942 if ( pObjectList->pObjects[pLayingItems[v18].uObjectDescID].uFlags & 0x10 14942 if ( pObjectList->pObjects[pSpriteObjects[v18].uObjectDescID].uFlags & 0x10
14943 || v17 >= 1000 14943 || v17 >= 1000
14944 || !pLayingItems[v18].uObjectDescID ) 14944 || !pSpriteObjects[v18].uObjectDescID )
14945 return 1; 14945 return 1;
14946 v19 = &pLayingItems[v18].stru_24; 14946 v19 = &pSpriteObjects[v18].stru_24;
14947 v20 = pLayingItems[v18].stru_24.uItemID; 14947 v20 = pSpriteObjects[v18].stru_24.uItemID;
14948 if ( pItemsTable->pItems[v20].uEquipType == EQUIP_GOLD) 14948 if ( pItemsTable->pItems[v20].uEquipType == EQUIP_GOLD)
14949 { 14949 {
14950 party_finds_gold(v19->uSpecEnchantmentType, 0); 14950 party_finds_gold(v19->uSpecEnchantmentType, 0);
14951 viewparams->bRedrawGameUI = 1; 14951 viewparams->bRedrawGameUI = 1;
14952 v21 = v17; 14952 v21 = v17;
14964 _449B7E_toggle_bit(pParty->_quest_bits, 185, 1u); 14964 _449B7E_toggle_bit(pParty->_quest_bits, 185, 1u);
14965 if ( !pParty->AddItem(v19) ) 14965 if ( !pParty->AddItem(v19) )
14966 pParty->SetHoldingItem(v19); 14966 pParty->SetHoldingItem(v19);
14967 v21 = v26; 14967 v21 = v26;
14968 } 14968 }
14969 LayingItem::OnItemPickup(v21); 14969 SpriteObject::OnInteraction(v21);
14970 break; 14970 break;
14971 14971
14972 case OBJECT_Actor: 14972 case OBJECT_Actor:
14973 v12 = a1 >> 3; 14973 v12 = a1 >> 3;
14974 v13 = &pActors[a1 >> 3]; 14974 v13 = &pActors[a1 >> 3];
15440 v20 = (dword_720020_zvalues[v18] & 0xFFFFu) >> 3; 15440 v20 = (dword_720020_zvalues[v18] & 0xFFFFu) >> 3;
15441 if ( (dword_720020_zvalues[v18] & 7) == OBJECT_Item) 15441 if ( (dword_720020_zvalues[v18] & 7) == OBJECT_Item)
15442 { 15442 {
15443 if ( v20 >= 0x3E8 ) 15443 if ( v20 >= 0x3E8 )
15444 return 0; 15444 return 0;
15445 if ( !(pLayingItems[v20].uAttributes & 0x10) ) 15445 if ( !(pSpriteObjects[v20].uAttributes & 0x10) )
15446 { 15446 {
15447 v23 = pLayingItems[v20].stru_24.GetDisplayName(); 15447 v23 = pSpriteObjects[v20].stru_24.GetDisplayName();
15448 LABEL_36: 15448 LABEL_36:
15449 v24 = v23; 15449 v24 = v23;
15450 goto LABEL_51; 15450 goto LABEL_51;
15451 } 15451 }
15452 goto LABEL_41; 15452 goto LABEL_41;
15589 15589
15590 15590
15591 15591
15592 15592
15593 //----- (0046BEF1) -------------------------------------------------------- 15593 //----- (0046BEF1) --------------------------------------------------------
15594 void LayingItem::_46BEF1_apply_spells() 15594 void SpriteObject::_46BEF1_apply_spells()
15595 { 15595 {
15596 LayingItem *v1; // edi@1 15596 SpriteObject *v1; // edi@1
15597 Actor *v2; // esi@2 15597 Actor *v2; // esi@2
15598 __int16 v3; // fps@4 15598 __int16 v3; // fps@4
15599 unsigned __int8 v4; // c0@4 15599 unsigned __int8 v4; // c0@4
15600 unsigned __int8 v5; // c3@4 15600 unsigned __int8 v5; // c3@4
15601 signed int v6; // [sp+8h] [bp-4h]@1 15601 signed int v6; // [sp+8h] [bp-4h]@1
15633 15633
15634 15634
15635 //----- (0046BFFA) -------------------------------------------------------- 15635 //----- (0046BFFA) --------------------------------------------------------
15636 bool __fastcall _46BFFA_check_object_intercept(unsigned int uLayingItemID, signed int a2) 15636 bool __fastcall _46BFFA_check_object_intercept(unsigned int uLayingItemID, signed int a2)
15637 { 15637 {
15638 LayingItem *v2; // esi@1 15638 SpriteObject *v2; // esi@1
15639 ObjectDesc *v3; // ebx@1 15639 ObjectDesc *v3; // ebx@1
15640 unsigned __int16 v5; // cx@9 15640 unsigned __int16 v5; // cx@9
15641 unsigned __int16 v6; // cx@14 15641 unsigned __int16 v6; // cx@14
15642 signed int v7; // edx@14 15642 signed int v7; // edx@14
15643 unsigned int v8; // eax@19 15643 unsigned int v8; // eax@19
15786 int v151; // [sp+24h] [bp-8h]@1 15786 int v151; // [sp+24h] [bp-8h]@1
15787 signed int v152; // [sp+24h] [bp-8h]@208 15787 signed int v152; // [sp+24h] [bp-8h]@208
15788 unsigned int v153; // [sp+28h] [bp-4h]@1 15788 unsigned int v153; // [sp+28h] [bp-4h]@1
15789 15789
15790 v153 = uLayingItemID; 15790 v153 = uLayingItemID;
15791 v2 = &pLayingItems[uLayingItemID]; 15791 v2 = &pSpriteObjects[uLayingItemID];
15792 v3 = &pObjectList->pObjects[v2->uObjectDescID]; 15792 v3 = &pObjectList->pObjects[v2->uObjectDescID];
15793 v145 = a2; 15793 v145 = a2;
15794 v151 = a2 & 7; 15794 v151 = a2 & 7;
15795 if ( (a2 & 7) == OBJECT_Actor) 15795 if ( (a2 & 7) == OBJECT_Actor)
15796 { 15796 {
15811 v2->uAttributes = v5 & 0xFFFB; 15811 v2->uAttributes = v5 & 0xFFFB;
15812 } 15812 }
15813 } 15813 }
15814 if ( v151 == OBJECT_BModel && (v2->field_58_pid & 7) != OBJECT_Player) 15814 if ( v151 == OBJECT_BModel && (v2->field_58_pid & 7) != OBJECT_Player)
15815 BYTE2(pActors[v2->field_58_pid >> 3].uAttributes) |= 4u; 15815 BYTE2(pActors[v2->field_58_pid >> 3].uAttributes) |= 4u;
15816 v6 = v2->uItemType; 15816 v6 = v2->uType;
15817 v7 = v2->uItemType; 15817 v7 = v2->uType;
15818 if ( v7 > 3060 ) 15818 if ( v7 > 3060 )
15819 { 15819 {
15820 if ( v7 > 6090 ) 15820 if ( v7 > 6090 )
15821 { 15821 {
15822 if ( v7 > 8090 ) 15822 if ( v7 > 8090 )
15831 return 0; 15831 return 0;
15832 LABEL_191: 15832 LABEL_191:
15833 v98 = v6 + 1; 15833 v98 = v6 + 1;
15834 v99 = pObjectList->uNumObjects; 15834 v99 = pObjectList->uNumObjects;
15835 v32 = 0; 15835 v32 = 0;
15836 v2->uItemType = v98; 15836 v2->uType = v98;
15837 v146 = 0; 15837 v146 = 0;
15838 if ( (signed int)v99 > 0 ) 15838 if ( (signed int)v99 > 0 )
15839 { 15839 {
15840 v144 = (char *)&pObjectList->pObjects->uObjectID; 15840 v144 = (char *)&pObjectList->pObjects->uObjectID;
15841 while ( v98 != *(short *)v144 ) 15841 while ( v98 != *(short *)v144 )
15875 v2->_46BEF1_apply_spells(); 15875 v2->_46BEF1_apply_spells();
15876 LABEL_233: 15876 LABEL_233:
15877 if ( !v138 ) 15877 if ( !v138 )
15878 { 15878 {
15879 v109 = pObjectList->uNumObjects; 15879 v109 = pObjectList->uNumObjects;
15880 ++v2->uItemType; 15880 ++v2->uType;
15881 v110 = 0; 15881 v110 = 0;
15882 if ( (signed int)v109 <= 0 ) 15882 if ( (signed int)v109 <= 0 )
15883 { 15883 {
15884 LABEL_238: 15884 LABEL_238:
15885 v112 = 0; 15885 v112 = 0;
15886 } 15886 }
15887 else 15887 else
15888 { 15888 {
15889 v111 = (char *)&pObjectList->pObjects->uObjectID; 15889 v111 = (char *)&pObjectList->pObjects->uObjectID;
15890 while ( v2->uItemType != *(short *)v111 ) 15890 while ( v2->uType != *(short *)v111 )
15891 { 15891 {
15892 ++v110; 15892 ++v110;
15893 v111 += 56; 15893 v111 += 56;
15894 if ( v110 >= (signed int)v109 ) 15894 if ( v110 >= (signed int)v109 )
15895 goto LABEL_238; 15895 goto LABEL_238;
15896 } 15896 }
15897 v112 = v110; 15897 v112 = v110;
15898 } 15898 }
15899 v2->uObjectDescID = v112; 15899 v2->uObjectDescID = v112;
15900 if ( !v112 ) 15900 if ( !v112 )
15901 LayingItem::OnItemPickup(v153); 15901 SpriteObject::OnInteraction(v153);
15902 v2->vVelocity.z = 0; 15902 v2->vVelocity.z = 0;
15903 v2->vVelocity.y = 0; 15903 v2->vVelocity.y = 0;
15904 v2->vVelocity.x = 0; 15904 v2->vVelocity.x = 0;
15905 v2->uSpriteFrameID = 0; 15905 v2->uSpriteFrameID = 0;
15906 v113 = v2->uSoundID; 15906 v113 = v2->uSoundID;
15919 v126 = v115; 15919 v126 = v115;
15920 v116 = v143; 15920 v116 = v143;
15921 goto LABEL_269; 15921 goto LABEL_269;
15922 } 15922 }
15923 LABEL_246: 15923 LABEL_246:
15924 LayingItem::OnItemPickup(v153); 15924 SpriteObject::OnInteraction(v153);
15925 return 0; 15925 return 0;
15926 } 15926 }
15927 v106 = v145; 15927 v106 = v145;
15928 v150 = 0; 15928 v150 = 0;
15929 v139 = v106 >> 3; 15929 v139 = v106 >> 3;
15964 { 15964 {
15965 v108 = v139; 15965 v108 = v139;
15966 if ( stru_50C198.GetMagicalResistance(&pActors[v139], v107) ) 15966 if ( stru_50C198.GetMagicalResistance(&pActors[v139], v107) )
15967 { 15967 {
15968 v138 = 0; 15968 v138 = 0;
15969 if ( v2->uItemType == 8030 ) 15969 if ( v2->uType == 8030 )
15970 { 15970 {
15971 pActors[v108].uAIState = Standing; 15971 pActors[v108].uAIState = Standing;
15972 pActors[v108].UpdateAnimation(); 15972 pActors[v108].UpdateAnimation();
15973 } 15973 }
15974 pActors[v108].pActorBuffs[v136].Apply( 15974 pActors[v108].pActorBuffs[v136].Apply(
16000 { 16000 {
16001 if ( v151 == 3 16001 if ( v151 == 3
16002 && MonsterStats::BelongsToSupertype(pActors[v145 >> 3].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) 16002 && MonsterStats::BelongsToSupertype(pActors[v145 >> 3].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
16003 sub_43A97E(v153, v145); 16003 sub_43A97E(v153, v145);
16004 v93 = pObjectList->uNumObjects; 16004 v93 = pObjectList->uNumObjects;
16005 ++v2->uItemType; 16005 ++v2->uType;
16006 v9 = 0; 16006 v9 = 0;
16007 v52 = 0; 16007 v52 = 0;
16008 if ( (signed int)v93 > 0 ) 16008 if ( (signed int)v93 > 0 )
16009 { 16009 {
16010 v94 = (char *)&pObjectList->pObjects->uObjectID; 16010 v94 = (char *)&pObjectList->pObjects->uObjectID;
16011 while ( v2->uItemType != *(short *)v94 ) 16011 while ( v2->uType != *(short *)v94 )
16012 { 16012 {
16013 ++v52; 16013 ++v52;
16014 v94 += 56; 16014 v94 += 56;
16015 if ( v52 >= (signed int)v93 ) 16015 if ( v52 >= (signed int)v93 )
16016 goto LABEL_181; 16016 goto LABEL_181;
16046 v55 = pObjectList->uNumObjects; 16046 v55 = pObjectList->uNumObjects;
16047 v9 = 0; 16047 v9 = 0;
16048 v56 = 0; 16048 v56 = 0;
16049 v44 = pObjectList->uNumObjects == 0; 16049 v44 = pObjectList->uNumObjects == 0;
16050 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0; 16050 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
16051 v2->uItemType = v54; 16051 v2->uType = v54;
16052 if ( v20 | v44 ) 16052 if ( v20 | v44 )
16053 { 16053 {
16054 LABEL_102: 16054 LABEL_102:
16055 v58 = 0; 16055 v58 = 0;
16056 } 16056 }
16066 } 16066 }
16067 v58 = v56; 16067 v58 = v56;
16068 } 16068 }
16069 v2->uObjectDescID = v58; 16069 v2->uObjectDescID = v58;
16070 if ( !v58 ) 16070 if ( !v58 )
16071 LayingItem::OnItemPickup(v153); 16071 SpriteObject::OnInteraction(v153);
16072 v14 = v153; 16072 v14 = v153;
16073 v2->vVelocity.z = 0; 16073 v2->vVelocity.z = 0;
16074 v2->vVelocity.y = 0; 16074 v2->vVelocity.y = 0;
16075 v2->vVelocity.x = 0; 16075 v2->vVelocity.x = 0;
16076 v2->uSpriteFrameID = 0; 16076 v2->uSpriteFrameID = 0;
16102 v60 = pObjectList->uNumObjects; 16102 v60 = pObjectList->uNumObjects;
16103 v9 = 0; 16103 v9 = 0;
16104 v61 = 0; 16104 v61 = 0;
16105 v44 = pObjectList->uNumObjects == 0; 16105 v44 = pObjectList->uNumObjects == 0;
16106 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0; 16106 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
16107 v2->uItemType = v59; 16107 v2->uType = v59;
16108 if ( v20 | v44 ) 16108 if ( v20 | v44 )
16109 { 16109 {
16110 LABEL_111: 16110 LABEL_111:
16111 v63 = 0; 16111 v63 = 0;
16112 } 16112 }
16122 } 16122 }
16123 v63 = v61; 16123 v63 = v61;
16124 } 16124 }
16125 v2->uObjectDescID = v63; 16125 v2->uObjectDescID = v63;
16126 if ( !v63 ) 16126 if ( !v63 )
16127 LayingItem::OnItemPickup(v153); 16127 SpriteObject::OnInteraction(v153);
16128 v64 = v2->uFacing - stru_5C6E00->uIntegerDoublePi; 16128 v64 = v2->uFacing - stru_5C6E00->uIntegerDoublePi;
16129 v44 = v2->field_50 == 4; 16129 v44 = v2->field_50 == 4;
16130 v2->vVelocity.z = 0; 16130 v2->vVelocity.z = 0;
16131 v2->vVelocity.y = 0; 16131 v2->vVelocity.y = 0;
16132 v2->vVelocity.x = 0; 16132 v2->vVelocity.x = 0;
16145 while ( v141 ); 16145 while ( v141 );
16146 } 16146 }
16147 LABEL_160: 16147 LABEL_160:
16148 v14 = v153; 16148 v14 = v153;
16149 LABEL_34: 16149 LABEL_34:
16150 LayingItem::OnItemPickup(v14); 16150 SpriteObject::OnInteraction(v14);
16151 goto LABEL_35; 16151 goto LABEL_35;
16152 } 16152 }
16153 if ( v151 == 6 || v151 == 5 || (v66 = 0, !v151) ) 16153 if ( v151 == 6 || v151 == 5 || (v66 = 0, !v151) )
16154 return 1; 16154 return 1;
16155 v67 = v6 + 1; 16155 v67 = v6 + 1;
16156 v68 = pObjectList->uNumObjects; 16156 v68 = pObjectList->uNumObjects;
16157 v69 = 0; 16157 v69 = 0;
16158 v44 = pObjectList->uNumObjects == 0; 16158 v44 = pObjectList->uNumObjects == 0;
16159 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0; 16159 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
16160 v2->uItemType = v67; 16160 v2->uType = v67;
16161 if ( v20 | v44 ) 16161 if ( v20 | v44 )
16162 { 16162 {
16163 LABEL_128: 16163 LABEL_128:
16164 v71 = 0; 16164 v71 = 0;
16165 } 16165 }
16175 } 16175 }
16176 v71 = v69; 16176 v71 = v69;
16177 } 16177 }
16178 v2->uObjectDescID = v71; 16178 v2->uObjectDescID = v71;
16179 if ( !v71 ) 16179 if ( !v71 )
16180 LayingItem::OnItemPickup(v153); 16180 SpriteObject::OnInteraction(v153);
16181 v134 = 0; 16181 v134 = 0;
16182 v72 = v153; 16182 v72 = v153;
16183 v132 = 0; 16183 v132 = 0;
16184 LABEL_132: 16184 LABEL_132:
16185 v73 = v2->vPosition.z; 16185 v73 = v2->vPosition.z;
16211 v85 = pObjectList->uNumObjects; 16211 v85 = pObjectList->uNumObjects;
16212 v9 = 0; 16212 v9 = 0;
16213 v86 = 0; 16213 v86 = 0;
16214 v44 = pObjectList->uNumObjects == 0; 16214 v44 = pObjectList->uNumObjects == 0;
16215 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0; 16215 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
16216 v2->uItemType = v84; 16216 v2->uType = v84;
16217 if ( v20 | v44 ) 16217 if ( v20 | v44 )
16218 { 16218 {
16219 LABEL_155: 16219 LABEL_155:
16220 v88 = 0; 16220 v88 = 0;
16221 } 16221 }
16231 } 16231 }
16232 v88 = v86; 16232 v88 = v86;
16233 } 16233 }
16234 v2->uObjectDescID = v88; 16234 v2->uObjectDescID = v88;
16235 if ( !v88 ) 16235 if ( !v88 )
16236 LayingItem::OnItemPickup(v153); 16236 SpriteObject::OnInteraction(v153);
16237 v89 = v2->uFacing - stru_5C6E00->uIntegerDoublePi; 16237 v89 = v2->uFacing - stru_5C6E00->uIntegerDoublePi;
16238 v2->vVelocity.z = 0; 16238 v2->vVelocity.z = 0;
16239 v2->vVelocity.y = 0; 16239 v2->vVelocity.y = 0;
16240 v2->vVelocity.x = 0; 16240 v2->vVelocity.x = 0;
16241 v142 = v89; 16241 v142 = v89;
16258 v80 = pObjectList->uNumObjects; 16258 v80 = pObjectList->uNumObjects;
16259 v66 = 0; 16259 v66 = 0;
16260 v81 = 0; 16260 v81 = 0;
16261 v44 = pObjectList->uNumObjects == 0; 16261 v44 = pObjectList->uNumObjects == 0;
16262 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0; 16262 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
16263 v2->uItemType = 4091; 16263 v2->uType = 4091;
16264 if ( v20 | v44 ) 16264 if ( v20 | v44 )
16265 { 16265 {
16266 LABEL_144: 16266 LABEL_144:
16267 v83 = 0; 16267 v83 = 0;
16268 } 16268 }
16278 } 16278 }
16279 v83 = v81; 16279 v83 = v81;
16280 } 16280 }
16281 v2->uObjectDescID = v83; 16281 v2->uObjectDescID = v83;
16282 if ( !v83 ) 16282 if ( !v83 )
16283 LayingItem::OnItemPickup(v153); 16283 SpriteObject::OnInteraction(v153);
16284 v134 = 0; 16284 v134 = 0;
16285 v72 = v153; 16285 v72 = v153;
16286 v132 = v2->field_61; 16286 v132 = v2->field_61;
16287 goto LABEL_132; 16287 goto LABEL_132;
16288 } 16288 }
16300 { 16300 {
16301 if ( v7 == 555 ) 16301 if ( v7 == 555 )
16302 { 16302 {
16303 sub_43A97E(v153, v145); 16303 sub_43A97E(v153, v145);
16304 v23 = pObjectList->uNumObjects; 16304 v23 = pObjectList->uNumObjects;
16305 ++v2->uItemType; 16305 ++v2->uType;
16306 v18 = 0; 16306 v18 = 0;
16307 v24 = 0; 16307 v24 = 0;
16308 if ( (signed int)v23 <= 0 ) 16308 if ( (signed int)v23 <= 0 )
16309 { 16309 {
16310 LABEL_41: 16310 LABEL_41:
16311 v22 = 0; 16311 v22 = 0;
16312 } 16312 }
16313 else 16313 else
16314 { 16314 {
16315 v25 = (char *)&pObjectList->pObjects->uObjectID; 16315 v25 = (char *)&pObjectList->pObjects->uObjectID;
16316 while ( v2->uItemType != *(short *)v25 ) 16316 while ( v2->uType != *(short *)v25 )
16317 { 16317 {
16318 ++v24; 16318 ++v24;
16319 v25 += 56; 16319 v25 += 56;
16320 if ( v24 >= (signed int)v23 ) 16320 if ( v24 >= (signed int)v23 )
16321 goto LABEL_41; 16321 goto LABEL_41;
16323 v22 = v24; 16323 v22 = v24;
16324 } 16324 }
16325 LABEL_42: 16325 LABEL_42:
16326 v2->uObjectDescID = v22; 16326 v2->uObjectDescID = v22;
16327 if ( v22 == v18 ) 16327 if ( v22 == v18 )
16328 LayingItem::OnItemPickup(v153); 16328 SpriteObject::OnInteraction(v153);
16329 v2->vVelocity.z = v18; 16329 v2->vVelocity.z = v18;
16330 v2->vVelocity.y = v18; 16330 v2->vVelocity.y = v18;
16331 v2->vVelocity.x = v18; 16331 v2->vVelocity.x = v18;
16332 v2->uSpriteFrameID = v18; 16332 v2->uSpriteFrameID = v18;
16333 } 16333 }
16344 case 530: 16344 case 530:
16345 case 535: 16345 case 535:
16346 case 540: 16346 case 540:
16347 sub_43A97E(v153, v145); 16347 sub_43A97E(v153, v145);
16348 v8 = pObjectList->uNumObjects; 16348 v8 = pObjectList->uNumObjects;
16349 ++v2->uItemType; 16349 ++v2->uType;
16350 v9 = 0; 16350 v9 = 0;
16351 v10 = 0; 16351 v10 = 0;
16352 if ( (signed int)v8 <= 0 ) 16352 if ( (signed int)v8 <= 0 )
16353 goto LABEL_23; 16353 goto LABEL_23;
16354 v11 = (char *)&pObjectList->pObjects->uObjectID; 16354 v11 = (char *)&pObjectList->pObjects->uObjectID;
16369 v17 = pObjectList->uNumObjects; 16369 v17 = pObjectList->uNumObjects;
16370 v18 = 0; 16370 v18 = 0;
16371 v19 = 0; 16371 v19 = 0;
16372 v44 = pObjectList->uNumObjects == 0; 16372 v44 = pObjectList->uNumObjects == 0;
16373 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0; 16373 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
16374 v2->uItemType = 600; 16374 v2->uType = 600;
16375 if ( v20 | v44 ) 16375 if ( v20 | v44 )
16376 goto LABEL_41; 16376 goto LABEL_41;
16377 v21 = (char *)&pObjectList->pObjects->uObjectID; 16377 v21 = (char *)&pObjectList->pObjects->uObjectID;
16378 while ( *(short *)v21 != 600 ) 16378 while ( *(short *)v21 != 600 )
16379 { 16379 {
16385 v22 = v19; 16385 v22 = v19;
16386 goto LABEL_42; 16386 goto LABEL_42;
16387 default: 16387 default:
16388 return 0; 16388 return 0;
16389 } 16389 }
16390 while ( v2->uItemType != *(short *)v11 ) 16390 while ( v2->uType != *(short *)v11 )
16391 { 16391 {
16392 ++v10; 16392 ++v10;
16393 v11 += 56; 16393 v11 += 56;
16394 if ( v10 >= (signed int)v8 ) 16394 if ( v10 >= (signed int)v8 )
16395 { 16395 {
16400 } 16400 }
16401 v12 = v10; 16401 v12 = v10;
16402 LABEL_24: 16402 LABEL_24:
16403 v2->uObjectDescID = v12; 16403 v2->uObjectDescID = v12;
16404 if ( !v12 ) 16404 if ( !v12 )
16405 LayingItem::OnItemPickup(v153); 16405 SpriteObject::OnInteraction(v153);
16406 v44 = v2->uItemType == 555; 16406 v44 = v2->uType == 555;
16407 v2->vVelocity.z = 0; 16407 v2->vVelocity.z = 0;
16408 v2->vVelocity.y = 0; 16408 v2->vVelocity.y = 0;
16409 v2->vVelocity.x = 0; 16409 v2->vVelocity.x = 0;
16410 v2->uSpriteFrameID = 0; 16410 v2->uSpriteFrameID = 0;
16411 if ( !v44 ) 16411 if ( !v44 )
16431 return 0; 16431 return 0;
16432 } 16432 }
16433 LABEL_93: 16433 LABEL_93:
16434 sub_43A97E(v153, v145); 16434 sub_43A97E(v153, v145);
16435 v51 = pObjectList->uNumObjects; 16435 v51 = pObjectList->uNumObjects;
16436 ++v2->uItemType; 16436 ++v2->uType;
16437 v9 = 0; 16437 v9 = 0;
16438 v52 = 0; 16438 v52 = 0;
16439 if ( (signed int)v51 > 0 ) 16439 if ( (signed int)v51 > 0 )
16440 { 16440 {
16441 v53 = (char *)&pObjectList->pObjects->uObjectID; 16441 v53 = (char *)&pObjectList->pObjects->uObjectID;
16442 while ( v2->uItemType != *(short *)v53 ) 16442 while ( v2->uType != *(short *)v53 )
16443 { 16443 {
16444 ++v52; 16444 ++v52;
16445 v53 += 56; 16445 v53 += 56;
16446 if ( v52 >= (signed int)v51 ) 16446 if ( v52 >= (signed int)v51 )
16447 goto LABEL_181; 16447 goto LABEL_181;
16451 LABEL_181: 16451 LABEL_181:
16452 v95 = 0; 16452 v95 = 0;
16453 LABEL_182: 16453 LABEL_182:
16454 v2->uObjectDescID = v95; 16454 v2->uObjectDescID = v95;
16455 if ( v95 == (short)v9 ) 16455 if ( v95 == (short)v9 )
16456 LayingItem::OnItemPickup(v153); 16456 SpriteObject::OnInteraction(v153);
16457 v96 = v2->uSoundID; 16457 v96 = v2->uSoundID;
16458 v2->vVelocity.z = v9; 16458 v2->vVelocity.z = v9;
16459 v2->vVelocity.y = v9; 16459 v2->vVelocity.y = v9;
16460 v2->vVelocity.x = v9; 16460 v2->vVelocity.x = v9;
16461 v2->uSpriteFrameID = v9; 16461 v2->uSpriteFrameID = v9;
16476 { 16476 {
16477 v33 = pObjectList->uNumObjects; 16477 v33 = pObjectList->uNumObjects;
16478 v34 = 0; 16478 v34 = 0;
16479 v44 = pObjectList->uNumObjects == 0; 16479 v44 = pObjectList->uNumObjects == 0;
16480 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0; 16480 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
16481 v2->uItemType = 601; 16481 v2->uType = 601;
16482 if ( v20 | v44 ) 16482 if ( v20 | v44 )
16483 { 16483 {
16484 LABEL_69: 16484 LABEL_69:
16485 v36 = 0; 16485 v36 = 0;
16486 } 16486 }
16496 } 16496 }
16497 v36 = v34; 16497 v36 = v34;
16498 } 16498 }
16499 v2->uObjectDescID = v36; 16499 v2->uObjectDescID = v36;
16500 if ( !v36 ) 16500 if ( !v36 )
16501 LayingItem::OnItemPickup(v153); 16501 SpriteObject::OnInteraction(v153);
16502 v37 = v2->vPosition.z; 16502 v37 = v2->vPosition.z;
16503 v2->vVelocity.z = 0; 16503 v2->vVelocity.z = 0;
16504 v38 = 8 * v153; 16504 v38 = 8 * v153;
16505 v39 = v2->vPosition.y; 16505 v39 = v2->vPosition.y;
16506 LOBYTE(v38) = 8 * v153 | 2; 16506 LOBYTE(v38) = 8 * v153 | 2;
16536 if ( v151 != 3 ) 16536 if ( v151 != 3 )
16537 { 16537 {
16538 v30 = v6 + 1; 16538 v30 = v6 + 1;
16539 v31 = pObjectList->uNumObjects; 16539 v31 = pObjectList->uNumObjects;
16540 v32 = 0; 16540 v32 = 0;
16541 v2->uItemType = v30; 16541 v2->uType = v30;
16542 v146 = 0; 16542 v146 = 0;
16543 if ( (signed int)v31 > 0 ) 16543 if ( (signed int)v31 > 0 )
16544 { 16544 {
16545 v140 = (char *)&pObjectList->pObjects->uObjectID; 16545 v140 = (char *)&pObjectList->pObjects->uObjectID;
16546 while ( v30 != *(short *)v140 ) 16546 while ( v30 != *(short *)v140 )
16553 LABEL_80: 16553 LABEL_80:
16554 v46 = v146; 16554 v46 = v146;
16555 LABEL_196: 16555 LABEL_196:
16556 v2->uObjectDescID = v46; 16556 v2->uObjectDescID = v46;
16557 if ( v46 == (short)v32 ) 16557 if ( v46 == (short)v32 )
16558 LayingItem::OnItemPickup(v153); 16558 SpriteObject::OnInteraction(v153);
16559 v100 = v2->field_61; 16559 v100 = v2->field_61;
16560 v101 = v2->vPosition.z; 16560 v101 = v2->vPosition.z;
16561 v2->uSpriteFrameID = v32; 16561 v2->uSpriteFrameID = v32;
16562 v102 = 8 * v153; 16562 v102 = 8 * v153;
16563 v103 = v2->vPosition.y; 16563 v103 = v2->vPosition.y;
16598 return 1; 16598 return 1;
16599 if ( v151 != 2 ) 16599 if ( v151 != 2 )
16600 { 16600 {
16601 sub_43A97E(v153, v145); 16601 sub_43A97E(v153, v145);
16602 v122 = pObjectList->uNumObjects; 16602 v122 = pObjectList->uNumObjects;
16603 ++v2->uItemType; 16603 ++v2->uType;
16604 v52 = 0; 16604 v52 = 0;
16605 if ( (signed int)v122 > 0 ) 16605 if ( (signed int)v122 > 0 )
16606 { 16606 {
16607 v123 = (char *)&pObjectList->pObjects->uObjectID; 16607 v123 = (char *)&pObjectList->pObjects->uObjectID;
16608 while ( v2->uItemType != *(short *)v123 ) 16608 while ( v2->uType != *(short *)v123 )
16609 { 16609 {
16610 ++v52; 16610 ++v52;
16611 v123 += 56; 16611 v123 += 56;
16612 if ( v52 >= (signed int)v122 ) 16612 if ( v52 >= (signed int)v122 )
16613 goto LABEL_181; 16613 goto LABEL_181;
16621 v117 = v6 + 1; 16621 v117 = v6 + 1;
16622 v118 = pObjectList->uNumObjects; 16622 v118 = pObjectList->uNumObjects;
16623 v119 = 0; 16623 v119 = 0;
16624 v44 = pObjectList->uNumObjects == 0; 16624 v44 = pObjectList->uNumObjects == 0;
16625 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0; 16625 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
16626 v2->uItemType = v117; 16626 v2->uType = v117;
16627 if ( v20 | v44 ) 16627 if ( v20 | v44 )
16628 { 16628 {
16629 LABEL_255: 16629 LABEL_255:
16630 v121 = 0; 16630 v121 = 0;
16631 } 16631 }
16641 } 16641 }
16642 v121 = v119; 16642 v121 = v119;
16643 } 16643 }
16644 v2->uObjectDescID = v121; 16644 v2->uObjectDescID = v121;
16645 if ( !v121 ) 16645 if ( !v121 )
16646 LayingItem::OnItemPickup(v153); 16646 SpriteObject::OnInteraction(v153);
16647 v2->vVelocity.z = 0; 16647 v2->vVelocity.z = 0;
16648 v2->vVelocity.y = 0; 16648 v2->vVelocity.y = 0;
16649 v2->vVelocity.x = 0; 16649 v2->vVelocity.x = 0;
16650 v2->uSpriteFrameID = 0; 16650 v2->uSpriteFrameID = 0;
16651 LABEL_27: 16651 LABEL_27: