comparison Items.cpp @ 2288:406605240b0a

GetItemTextureFilename cleaned up
author Grumpy7
date Sun, 16 Mar 2014 02:59:52 +0100
parents 4e3236a4ea63
children 60293358b4b3
comparison
equal deleted inserted replaced
2287:4e3236a4ea63 2288:406605240b0a
2113 return elemsAlreadyPresent + 1; 2113 return elemsAlreadyPresent + 1;
2114 } 2114 }
2115 return elemsNeeded; 2115 return elemsNeeded;
2116 } 2116 }
2117 //----- (0043C91D) -------------------------------------------------------- 2117 //----- (0043C91D) --------------------------------------------------------
2118 int __fastcall GetItemTextureFilename(char *pOut, signed int item_id, int index, int shoulder) 2118 int GetItemTextureFilename(char *pOut, signed int item_id, int index, int shoulder)
2119 { 2119 {
2120 int result; // eax@2 2120 int result; // eax@2
2121 char v5; // zf@3
2122 2121
2123 result = 0; //BUG fn is void 2122 result = 0; //BUG fn is void
2124 if ( item_id <= 500 ) 2123 if ( item_id > 500 )
2125 { 2124 {
2126 //v5 = *((char *)&pBloodsplatContainer->std__vector_pBloodsplats[62].field_20 + a2 + 2) == 0;
2127 v5 = party_has_equipment[(item_id - 100) + 32 + 2] == 0;
2128 switch ( item_id ) 2125 switch ( item_id )
2129 { 2126 {
2130 case 516: 2127 case 516:
2131 v5 = byte_5111F6[2] == 0; 2128 if (byte_5111F6[2] != 0)
2132 break; 2129 item_id = 234;
2133 case 505: 2130 break;
2134 v5 = byte_5111F6[1] == 0; 2131 case 505:
2135 break; 2132 if (byte_5111F6[1] != 0)
2136 case 504: 2133 item_id = 236;
2137 v5 = byte_5111F6[0] == 0; 2134 break;
2138 break; 2135 case 504:
2139 case 533: 2136 if (byte_5111F6[0] != 0)
2140 v5 = byte_5111F6[16] == 0; 2137 item_id = 235;
2141 break; 2138 break;
2142 case 512: 2139 case 533:
2143 v5 = byte_5111F6[3] == 0; 2140 if (byte_5111F6[16] != 0)
2144 break; 2141 item_id = 73;
2145 case 521: 2142 break;
2146 v5 = byte_5111F6[4] == 0; 2143 case 512:
2147 break; 2144 if (byte_5111F6[3] != 0)
2148 case 522: 2145 item_id = 312;
2149 v5 = byte_5111F6[5] == 0; 2146 break;
2150 break; 2147 case 521:
2151 case 523: 2148 if (byte_5111F6[4] != 0)
2152 v5 = byte_5111F6[6] == 0; 2149 item_id = 239;
2153 break; 2150 break;
2154 case 532: 2151 case 522:
2155 v5 = byte_5111F6[7] == 0; 2152 if (byte_5111F6[5] != 0)
2156 break; 2153 item_id = 240;
2157 case 544: 2154 break;
2158 v5 = byte_5111F6[8] == 0; 2155 case 523:
2159 break; 2156 if (byte_5111F6[6] != 0)
2160 case 524: 2157 item_id = 241;
2161 v5 = byte_5111F6[9] == 0; 2158 break;
2162 break; 2159 case 532:
2163 case 535: 2160 if (byte_5111F6[7] != 0)
2164 v5 = byte_5111F6[10] == 0; 2161 item_id = 93;
2165 break; 2162 break;
2166 case 525: 2163 case 544:
2167 v5 = byte_5111F6[11] == 0; 2164 if (byte_5111F6[8] != 0)
2168 break; 2165 item_id = 344;
2169 case 530: 2166 break;
2170 v5 = byte_5111F6[12] == 0; 2167 case 524:
2171 break; 2168 if (byte_5111F6[9] != 0)
2172 case 547: 2169 item_id = 324;
2173 v5 = byte_5111F6[13] == 0; 2170 break;
2174 break; 2171 case 535:
2175 case 548: 2172 if (byte_5111F6[10] != 0)
2176 v5 = byte_5111F6[14] == 0; 2173 item_id = 104;
2177 break; 2174 break;
2178 case 550: 2175 case 525:
2179 v5 = byte_5111F6[15] == 0; 2176 if (byte_5111F6[11] != 0)
2180 break; 2177 item_id = 325;
2181 default: 2178 break;
2182 break; 2179 case 530:
2183 } 2180 if (byte_5111F6[12] != 0)
2184 if ( v5 ) 2181 item_id = 330;
2185 return result; 2182 break;
2186 result = 516; 2183 case 547:
2187 if ( item_id < 66 || item_id > 78 ) 2184 if (byte_5111F6[13] != 0)
2188 { 2185 item_id = 347;
2189 if ( item_id == 516 ) 2186 break;
2190 { 2187 case 548:
2191 if ( !shoulder ) 2188 if (byte_5111F6[14] != 0)
2192 return sprintf(pOut, "item%3.3dv%d", 234, index); 2189 item_id = 348;
2193 if ( shoulder == 1 ) 2190 break;
2194 return sprintf(pOut, "item%3.3dv%da1", 234, index); 2191 case 550:
2195 if ( shoulder == 2 ) 2192 if (byte_5111F6[15] != 0)
2196 return sprintf(pOut, "item%3.3dv%da2", 234, index); 2193 item_id = 350;
2197 } 2194 break;
2198 if ( item_id != 504 && item_id != 505 && item_id != 533 ) 2195 default:
2199 { 2196 return 0;
2200 if ( (item_id < 100 || item_id > 104) && item_id != 524 && item_id != 535 ) 2197 }
2201 { 2198 }
2202 if ( item_id >= 115 && item_id <= 119 || item_id == 512 ) 2199
2203 { 2200 switch (pItemsTable->pItems[item_id].uEquipType)
2204 if ( item_id == 512 ) 2201 {
2205 item_id = 312; 2202 case EQUIP_ARMOUR:
2206 return sprintf(pOut, "item%3.3dv%d", item_id, index);
2207 }
2208 if ( (item_id < 89 || item_id > 99) && item_id != 521 && item_id != 522 && item_id != 523 && item_id != 532 && item_id != 544 )
2209 {
2210 result = 525;
2211 if ( (item_id < 105 || item_id > 109) && item_id != 525 && item_id != 530 && item_id != 547 && item_id != 548 && item_id != 550 )
2212 return result;
2213 switch ( item_id )
2214 {
2215 case 525:
2216 item_id = 325;
2217 break;
2218 case 530:
2219 item_id = 330;
2220 break;
2221 case 547:
2222 item_id = 347;
2223 break;
2224 case 548:
2225 item_id = 348;
2226 break;
2227 case 550:
2228 item_id = 350;
2229 break;
2230 }
2231 if ( !shoulder )
2232 return sprintf(pOut, "item%3.3dv%d", item_id, index);
2233 return sprintf(pOut, "item%3.3dv%da1", item_id, index);
2234 }
2235 if ( item_id == 521 )
2236 return sprintf(pOut, "item%3.3dv%d", 239, index);
2237 if ( item_id == 522 )
2238 return sprintf(pOut, "item%3.3dv%d", 240, index);
2239 if ( item_id == 523 )
2240 return sprintf(pOut, "item%3.3dv%d", 241, index);
2241 if ( item_id != 532 )
2242 {
2243 if ( item_id == 544 )
2244 item_id = 344;
2245 return sprintf(pOut, "item%3.3dv%d", item_id, index);
2246 }
2247 return sprintf(pOut, "item%3.3dv%d", 93, index);
2248 }
2249 if ( item_id == 524 )
2250 return sprintf(pOut, "item%3.3dv%d", 324, index);
2251 if ( item_id == 535 )
2252 item_id = 104;
2253 return sprintf(pOut, "item%3.3dv%d", item_id, index);
2254 }
2255 }
2256 if ( item_id != 516 )
2257 {
2258 switch ( item_id )
2259 {
2260 case 504:
2261 item_id = 235;
2262 break;
2263 case 505:
2264 item_id = 236;
2265 break;
2266 case 533:
2267 item_id = 73;
2268 break;
2269 }
2270 if ( !shoulder )
2271 return sprintf(pOut, "item%3.3dv%d", item_id, index);
2272 if ( shoulder == 1 )
2273 return sprintf(pOut, "item%3.3dv%da1", item_id, index);
2274 if ( shoulder == 2 )
2275 return sprintf(pOut, "item%3.3dv%da2", item_id, index);
2276 }
2277 if ( !shoulder ) 2203 if ( !shoulder )
2278 return sprintf(pOut, "item%3.3dv%d", 234, index); 2204 return sprintf(pOut, "item%3.3dv%d", item_id, index);
2279 if ( shoulder == 1 ) 2205 else if ( shoulder == 1 )
2280 return sprintf(pOut, "item%3.3dv%da1", 234, index); 2206 return sprintf(pOut, "item%3.3dv%da1", item_id, index);
2281 if ( shoulder == 2 ) 2207 else if ( shoulder == 2 )
2282 return sprintf(pOut, "item%3.3dv%da2", 234, index); 2208 return sprintf(pOut, "item%3.3dv%da2", item_id, index);
2283 } 2209 break;
2210 case EQUIP_CLOAK:
2211 if ( !shoulder )
2212 return sprintf(pOut, "item%3.3dv%d", item_id, index);
2213 else
2214 return sprintf(pOut, "item%3.3dv%da1", item_id, index);
2215 default:
2216 return sprintf(pOut, "item%3.3dv%d", item_id, index);
2217 }
2218
2284 result = item_id - 504; 2219 result = item_id - 504;
2285 return result; 2220 return result;
2286 } 2221 }
2287 2222
2288 2223