comparison Player.cpp @ 188:207b2492e14b

AddItem crash
author Nomad
date Fri, 15 Feb 2013 22:54:19 +0200
parents 49728858c35e
children 9b77686e2239
comparison
equal deleted inserted replaced
187:49728858c35e 188:207b2492e14b
2330 int v10; // eax@11 2330 int v10; // eax@11
2331 bool result; // eax@15 2331 bool result; // eax@15
2332 std::string v12; // [sp-18h] [bp-40h]@9 2332 std::string v12; // [sp-18h] [bp-40h]@9
2333 const char *v13; // [sp-8h] [bp-30h]@9 2333 const char *v13; // [sp-8h] [bp-30h]@9
2334 int v14; // [sp-4h] [bp-2Ch]@9 2334 int v14; // [sp-4h] [bp-2Ch]@9
2335 int v15; // [sp+Ch] [bp-1Ch]@3 2335 int v15[4] = {0, 1, 2, 3}; // [sp+Ch] [bp-1Ch]@3
2336 int v16; // [sp+10h] [bp-18h]@3 2336 //int v16; // [sp+10h] [bp-18h]@3
2337 int v17; // [sp+14h] [bp-14h]@3 2337 //int v17; // [sp+14h] [bp-14h]@3
2338 int v18; // [sp+18h] [bp-10h]@3 2338 //int v18; // [sp+18h] [bp-10h]@3
2339 Player *v19; // [sp+1Ch] [bp-Ch]@9 2339 Player *v19; // [sp+1Ch] [bp-Ch]@9
2340 Party *v20; // [sp+20h] [bp-8h]@1 2340 Party *v20; // [sp+20h] [bp-8h]@1
2341 int v21; // [sp+24h] [bp-4h]@10 2341 int v21; // [sp+24h] [bp-4h]@10
2342 2342
2343 auto thos = this; 2343 auto thos = this;
2344 2344
2345 v20 = thos; 2345 v20 = thos;
2346 v2 = pItem->uItemID; 2346 v2 = pItem->uItemID;
2347 if ( !BYTE2(pItemsTable->pItems[v2 + 1].uItemID) ) 2347 if ( !BYTE2(pItemsTable->pItems[v2 + 1].uItemID) )
2348 pItem->uAttributes |= 1u; 2348 pItem->uAttributes |= 1u;
2349 v15 = 0; 2349 ///v15 = 0;
2350 v16 = 1; 2350 //v16 = 1;
2351 v18 = 3; 2351 //v18 = 3;
2352 v17 = 2; 2352 //v17 = 2;
2353 if ( uActiveCharacter ) 2353 if ( uActiveCharacter )
2354 { 2354 {
2355 v3 = uActiveCharacter - 1; 2355 v3 = uActiveCharacter - 1;
2356 v4 = 0; 2356 v4 = 0;
2357 do 2357 do
2358 { 2358 {
2359 *(&v15 + v4++) = v3++; 2359 v15[v4++] = v3++;
2360 if ( (signed int)v3 >= 4 ) 2360 if ( (signed int)v3 >= 4 )
2361 v3 = 0; 2361 v3 = 0;
2362 } 2362 }
2363 while ( v4 < 4 ); 2363 while ( v4 < 4 );
2364 } 2364 }
2365 v5 = pItemsTable->pItems[v2].pIconName; 2365 v5 = pItemsTable->pItems[v2].pIconName;
2366 if ( v5 ) 2366 if ( v5 )
2367 { 2367 {
2368 v6 = pIcons_LOD->LoadTexture(v5, TEXTURE_16BIT_PALETTE); 2368 v6 = pIcons_LOD->LoadTexture(v5, TEXTURE_16BIT_PALETTE);
2369 v7 = (Texture *)(v6 != -1 ? (int)&pIcons_LOD->pTextures[v6] : 0); 2369 v7 = (Texture *)(v6 != -1 ? &pIcons_LOD->pTextures[v6] : 0);
2370 v21 = areWeLoadingTexture; 2370 v21 = areWeLoadingTexture;
2371 v8 = 0; 2371 v8 = 0;
2372 while ( 1 ) 2372 while ( 1 )
2373 { 2373 {
2374 v9 = &v20->pPlayers[*(&v15 + v8)]; 2374 v9 = &v20->pPlayers[v15[v8]];
2375 v19 = &v20->pPlayers[*(&v15 + v8)]; 2375 v19 = &v20->pPlayers[v15[v8]];
2376 v10 = v19->AddItem(0xFFFFFFFFu, pItem->uItemID); 2376 v10 = v19->AddItem(0xFFFFFFFFu, pItem->uItemID);
2377 if ( v10 ) 2377 if ( v10 )
2378 break; 2378 break;
2379 ++v8; 2379 ++v8;
2380 if ( v8 >= 4 ) 2380 if ( v8 >= 4 )