comparison mm7_4.cpp @ 702:efde64b3e147

sub_4BDAAF clean some Chest pointer fixes
author zipi
date Mon, 18 Mar 2013 20:19:20 +0000
parents d5b16a44d9b3
children ef4d646d738d
comparison
equal deleted inserted replaced
701:d5b16a44d9b3 702:efde64b3e147
11046 int v7; // edx@9 11046 int v7; // edx@9
11047 int v8; // edx@10 11047 int v8; // edx@10
11048 unsigned __int8 v9; // zf@16 11048 unsigned __int8 v9; // zf@16
11049 char v10; // sf@16 11049 char v10; // sf@16
11050 unsigned __int8 v11; // of@16 11050 unsigned __int8 v11; // of@16
11051 bool test;
11051 11052
11052 auto a2 = _2da_idx; 11053 auto a2 = _2da_idx;
11053 //v2 = p2DEvents_minus1___00[26 * a2]; 11054 //v2 = p2DEvents_minus1___00[26 * a2];
11054 v2 = p2DEvents[a2 - 1].uType; 11055 v2 = p2DEvents[a2 - 1].uType;
11055 v3 = a1->uItemID; 11056 v3 = a1->uItemID;
11056 v4 = a1->uItemID; 11057 v4 = a1->uItemID;
11057 v5 = pItemsTable->pItems[v4].uEquipType; 11058 v5 = pItemsTable->pItems[v4].uEquipType;
11058 if ( (v2 != 4 || (signed int)v3 < 740 || (signed int)v3 > 771) 11059 if ( (v2 != 4 || (signed int)v3 < 740 || (signed int)v3 > 771)
11059 && ((signed int)v3 >= 600 || (signed int)v3 >= 529 && (signed int)v3 <= 599) || a1->Stolen()) 11060 && ((signed int)v3 >= 600 || (signed int)v3 >= 529 && (signed int)v3 <= 599) || a1->Stolen())
11060 return 0; 11061 return 0;
11061 v6 = v2 - 1; 11062 switch( p2DEvents[a2 - 1].uType )
11062 if ( !v6 ) 11063 {
11064 case BildingType_WeaponShop:
11065 {
11066 test = v5 <= 2;
11067 break;
11068 }
11069 case BildingType_ArmorShop:
11070 {
11071 test = v5 >= 3;
11072 break;
11073 }
11074 case BildingType_MagicShop:
11075 {
11076 test = pItemsTable->pItems[v4].uSkillType == 38 || v5 == 16;
11077 break;
11078 }
11079 case BildingType_AlchemistShop:
11080 {
11081 __debugbreak(); // need to test
11082 test = v5 == 13 || v5 == 14 || (v5 > 14 && !(v5 != 17 || (signed int)v3 < 740) && v3 != 771);
11083 break;
11084 }
11085 default:
11086 {
11087 test = 0;
11088 break;
11089 }
11090 }
11091
11092 return test;
11093 /*
11094 if ( p2DEvents[a2 - 1].uType == 1 )
11063 { 11095 {
11064 v11 = __OFSUB__(v5, 2); 11096 v11 = __OFSUB__(v5, 2);
11065 v9 = v5 == 2; 11097 v9 = v5 == 2;
11066 v10 = v5 - 2 < 0; 11098 v10 = v5 - 2 < 0;
11067 goto LABEL_23; 11099 goto LABEL_23;
11068 } 11100 }
11069 v7 = v6 - 1; 11101 if ( p2DEvents[a2 - 1].uType > 2 )
11070 if ( v7 ) 11102 {
11071 { 11103 if ( p2DEvents[a2 - 1].uType == 3 )
11072 v8 = v7 - 1;
11073 if ( !v8 )
11074 { 11104 {
11075 if ( pItemsTable->pItems[v4].uSkillType != 38 ) 11105 if ( pItemsTable->pItems[v4].uSkillType != 38 )
11076 return v5 == 16; 11106 return v5 == 16;
11077 return 1; 11107 return 1;
11078 } 11108 }
11079 if ( v8 != 1 || v5 < 13 ) 11109 if ( p2DEvents[a2 - 1].uType != 4 || v5 < 13 )
11080 return 0; 11110 return 0;
11081 if ( v5 <= 14 ) 11111 if ( p2DEvents[a2 - 1].uType == 4)
11082 return 1; 11112 {
11083 if ( v5 != 17 || (signed int)v3 < 740 ) 11113 if ( v5 < 13 )
11084 return 0; 11114 return 0;
11085 v11 = __OFSUB__(v3, 771); 11115 if ( v5 <= 14 )
11086 v9 = v3 == 771; 11116 return 1;
11087 v10 = ((v3 - 771) & 0x80000000u) != 0; 11117 if ( v5 != 17 || (signed int)v3 < 740 )
11118 return 0;
11119 v11 = __OFSUB__(v3, 771);
11120 v9 = v3 == 771;
11121 v10 = ((v3 - 771) & 0x80000000u) != 0;
11088 LABEL_23: 11122 LABEL_23:
11089 if ( !((unsigned __int8)(v10 ^ v11) | v9) ) 11123 if ( !((unsigned __int8)(v10 ^ v11) | v9) )
11090 return 0; 11124 return 0;
11091 return 1; 11125 return 1;
11092 } 11126 }
11093 if ( v5 >= 3 ) 11127 }
11094 { 11128 if ( p2DEvents[a2 - 1].uType == 2 )
11095 v11 = __OFSUB__(v5, 9); 11129 {
11096 v9 = v5 == 9; 11130 if ( v5 >= 3 )
11097 v10 = v5 - 9 < 0; 11131 {
11098 goto LABEL_23; 11132 v11 = __OFSUB__(v5, 9);
11133 v9 = v5 == 9;
11134 v10 = v5 - 9 < 0;
11135 goto LABEL_23;
11136 }
11099 } 11137 }
11100 return 0; 11138 return 0;
11139 */
11101 } 11140 }
11102 11141
11103 11142
11104 11143
11105 11144