comparison Player.cpp @ 1692:92732b6fc196

Player::_48DCF6 cycle and unused var cleanup
author Grumpy7
date Sun, 22 Sep 2013 09:36:38 +0200
parents 1c880907575f
children 861ede68187a
comparison
equal deleted inserted replaced
1691:1c880907575f 1692:92732b6fc196
2271 int Player::_48DCF6(int a2, Actor *pActor) //TODO check this with IDA to see what the uninitialized vars are supposed to contain 2271 int Player::_48DCF6(int a2, Actor *pActor) //TODO check this with IDA to see what the uninitialized vars are supposed to contain
2272 { 2272 {
2273 signed int v3; // edi@1 2273 signed int v3; // edi@1
2274 signed int v4; // ebx@1 2274 signed int v4; // ebx@1
2275 int v6; // eax@2 2275 int v6; // eax@2
2276 int v7; // eax@5
2277 int v8; // eax@8 2276 int v8; // eax@8
2278 int v9; // ebx@8
2279 int v10; // eax@8 2277 int v10; // eax@8
2280 int v11; // ebx@8 2278 int v11; // ebx@8
2281 signed int v12; // edx@9 2279 signed int v12; // edx@9
2282 ItemGen *v13; // eax@9 2280 ItemGen *v13; // eax@9
2283 int v14; // edx@16 2281 int v14; // edx@16
2284 unsigned int v15; // edx@17
2285 int v16; // edx@26 2282 int v16; // edx@26
2286 unsigned int v17; // edx@27
2287 signed int v19; // edx@38 2283 signed int v19; // edx@38
2288 int *v20; // ecx@38
2289 signed int v21; // eax@40
2290 int v22; // eax@49 2284 int v22; // eax@49
2291 signed int v23; // ebx@49 2285 signed int v23; // ebx@49
2292 unsigned int v24; // eax@60
2293 int v25; // ecx@61
2294 int v26; // ebx@74
2295 void *v27; // ecx@76 2286 void *v27; // ecx@76
2296 unsigned int v28; // ebx@78
2297 signed int result; // eax@86
2298 SoundID v30; // [sp-20h] [bp-C0h]@56
2299 signed int v31; // [sp-1Ch] [bp-BCh]@56
2300 unsigned int v32; // [sp-18h] [bp-B8h]@56
2301 signed int v33; // [sp-14h] [bp-B4h]@56
2302 signed int v34; // [sp-10h] [bp-B0h]@56
2303 int v35; // [sp-Ch] [bp-ACh]@56
2304 unsigned int v36; // [sp-8h] [bp-A8h]@51
2305 unsigned int v37; // [sp-8h] [bp-A8h]@56
2306 unsigned int v38; // [sp-8h] [bp-A8h]@57
2307 unsigned int v39; // [sp-8h] [bp-A8h]@68
2308 enum CHARACTER_ATTRIBUTE_TYPE v40; // [sp-4h] [bp-A4h]@4 2287 enum CHARACTER_ATTRIBUTE_TYPE v40; // [sp-4h] [bp-A4h]@4
2309 int v41; // [sp-4h] [bp-A4h]@51
2310 int v42; // [sp-4h] [bp-A4h]@56
2311 int v43; // [sp-4h] [bp-A4h]@57
2312 signed int v44; // [sp-4h] [bp-A4h]@59
2313 int v45; // [sp-4h] [bp-A4h]@68
2314 char v46[140]; // [sp+Ch] [bp-94h]@13 2288 char v46[140]; // [sp+Ch] [bp-94h]@13
2315 unsigned int v47; // [sp+98h] [bp-8h]@1 2289 unsigned int v47; // [sp+98h] [bp-8h]@1
2316 int v48; // [sp+9Ch] [bp-4h]@1 2290 ItemGen* v48; // [sp+9Ch] [bp-4h]@1
2317 2291
2318 v3 = 0;
2319 v4 = 0; 2292 v4 = 0;
2320 v47 = 0; 2293 v47 = 0;
2321 v48 = 0;
2322 switch ( a2 ) 2294 switch ( a2 )
2323 { 2295 {
2324 case 1: 2296 case 1:
2325 v6 = GetActualWillpower(); 2297 v6 = GetActualWillpower();
2326 v11 = GetParameterBonus(v6); 2298 v11 = GetParameterBonus(v6);
2358 v8 = GetActualWillpower(); 2330 v8 = GetActualWillpower();
2359 v10 = GetActualIntelligence(); 2331 v10 = GetActualIntelligence();
2360 v11 = (GetParameterBonus(v10) + GetParameterBonus(v8)) / 2; 2332 v11 = (GetParameterBonus(v10) + GetParameterBonus(v8)) / 2;
2361 break; 2333 break;
2362 case 17: 2334 case 17:
2363 v12 = 0; 2335 for (int i = 0; i < 138; i++)
2364 v13 = this->pInventoryItemList; 2336 {
2365 do 2337 v13 = &this->pInventoryItemList[i];
2366 { 2338 if ( v13->uItemID > 0 && v13->uItemID <= 134 && !v13->IsBroken())
2367 if ( (signed int)v13->uItemID > 0 && (signed int)v13->uItemID <= 134 && !v13->IsBroken())
2368 v46[v4++] = v12; 2339 v46[v4++] = v12;
2369 ++v12; 2340 }
2370 ++v13;
2371 }
2372 while ( v12 < 138 );
2373 if ( !v4 ) 2341 if ( !v4 )
2374 return 0; 2342 return 0;
2375 v48 = (int)&this->pInventoryItemList[(unsigned __int8)v46[rand() % v4]]; 2343 v48 = &this->pInventoryItemList[v46[rand() % v4]];
2376 v11 = 3 * (pItemsTable->pItems[*(int *)v48].uMaterial + pItemsTable->pItems[*(int *)v48].uDamageMod); 2344 v11 = 3 * (pItemsTable->pItems[v48->uItemID].uMaterial + pItemsTable->pItems[v48->uItemID].uDamageMod);
2377 break; 2345 break;
2378 case 18: 2346 case 18:
2379 v14 = 0; 2347 for (int i = 0; i < 16; i++ )
2380 do
2381 { 2348 {
2382 if ( HasItemEquipped((ITEM_EQUIP_TYPE)v14) ) 2349 if ( HasItemEquipped((ITEM_EQUIP_TYPE)v14) )
2383 { 2350 {
2384 if ( v14 == EQUIP_ARMOUR ) 2351 if ( i == EQUIP_ARMOUR )
2385 v46[v4++] = LOBYTE(this->pEquipment.uArmor) - 1; 2352 v46[v4++] = this->pEquipment.uArmor - 1;
2386 if ( (!v14 || v14 == 1) && GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v14) == 4 ) 2353 if ( (i == EQUIP_OFF_HAND || i == EQUIP_MAIN_HAND) && GetEquippedItemEquipType((ITEM_EQUIP_TYPE)i) == EQUIP_SHIELD )
2387 v46[v4++] = *((char *)&this->pEquipment.uShield + 4 * v14) - 1; 2354 v46[v4++] = this->pEquipment.pIndices[i] - 1;
2388 } 2355 }
2389 v14++; 2356 }
2390 }
2391 while ( v14 < 16 );
2392 if ( !v4 ) 2357 if ( !v4 )
2393 return 0; 2358 return 0;
2394 v48 = (int)&this->pInventoryItemList[(unsigned __int8)v46[rand() % v4]]; 2359 v48 = &this->pInventoryItemList[v46[rand() % v4]];
2395 v11 = 3 * (pItemsTable->pItems[*(int *)v48].uMaterial + pItemsTable->pItems[*(int *)v48].uDamageMod); 2360 v11 = 3 * (pItemsTable->pItems[v48->uItemID].uMaterial + pItemsTable->pItems[v48->uItemID].uDamageMod);
2396 break; 2361 break;
2397 case 19: 2362 case 19:
2398 v16 = 0; 2363 for (int i = 0; i < 16; i++ )
2399 do
2400 { 2364 {
2401 if ( HasItemEquipped((ITEM_EQUIP_TYPE)v16) ) 2365 if ( HasItemEquipped((ITEM_EQUIP_TYPE)v16) )
2402 { 2366 {
2403 if ( v16 == 2 ) 2367 if ( v16 == EQUIP_BOW )
2404 v46[v4++] = LOBYTE(this->pEquipment.uBow) - 1; 2368 v46[v4++] = LOBYTE(this->pEquipment.uBow) - 1;
2405 if ( (!v16 || v16 == 1) 2369 if ( (v16 == EQUIP_OFF_HAND || v16 == EQUIP_MAIN_HAND)
2406 && (!GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v16) || GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v16) == 1) ) 2370 && (GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v16) == EQUIP_OFF_HAND || GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v16) == EQUIP_MAIN_HAND) )
2407 v46[v4++] = *((char *)&this->pEquipment.uShield + 4 * v16) - 1; 2371 v46[v4++] = this->pEquipment.pIndices[v16] - 1;
2408 } 2372 }
2409 v16++; 2373 }
2410 }
2411 while ( v16 < 16 );
2412 if ( !v4 ) 2374 if ( !v4 )
2413 return 0; 2375 return 0;
2414 v48 = (int)&this->pInventoryItemList[(unsigned __int8)v46[rand() % v4]]; 2376 v48 = &this->pInventoryItemList[v46[rand() % v4]];
2415 v11 = 3 * (pItemsTable->pItems[*(int *)v48].uMaterial + pItemsTable->pItems[*(int *)v48].uDamageMod); 2377 v11 = 3 * (pItemsTable->pItems[v48->uItemID].uMaterial + pItemsTable->pItems[v48->uItemID].uDamageMod);
2416 break; 2378 break;
2417 case 20: 2379 case 20:
2418 v19 = 0; 2380 for ( int i = 0; i < 126; i++ )
2419 v20 = this->pInventoryMatrix; 2381 {
2420 do 2382 int ItemPosInList = this->pInventoryMatrix[i];
2421 { 2383 if (ItemPosInList > 0)
2422 if ( *v20 > 0 )
2423 { 2384 {
2424 v21 = *(int *)&this->pInventoryItemList[*v20-1]; 2385 ItemGen* v21 = &this->pInventoryItemList[ItemPosInList - 1];
2425 if ( v21 > 0 ) 2386 if ( v21->uItemID > 0 && v21->uItemID <= 134 )
2426 { 2387 {
2427 if ( v21 <= 134 )
2428 v46[v4++] = v19; 2388 v46[v4++] = v19;
2429 } 2389 }
2430 } 2390 }
2431 ++v19; 2391 }
2432 ++v20;
2433 }
2434 while ( v19 < 126 );
2435 if ( !v4 ) 2392 if ( !v4 )
2436 return 0; 2393 return 0;
2437 v47 = (unsigned __int8)v46[rand() % v4]; 2394 v47 = v46[rand() % v4];
2438 v6 = GetActualAccuracy(); 2395 v6 = GetActualAccuracy();
2439 v11 = GetParameterBonus(v6); 2396 v11 = GetParameterBonus(v6);
2440 break; 2397 break;
2441 default: 2398 default:
2442 v11 = 0; 2399 v11 = 0;
2448 { 2405 {
2449 return 0; 2406 return 0;
2450 } 2407 }
2451 else 2408 else
2452 { 2409 {
2410 for ( v3 = 0; v3 < 4; v3++ )
2411 {
2412 if ( this == pPlayers[v3 + 1] )
2413 break;
2414 }
2415
2453 switch ( a2 ) 2416 switch ( a2 )
2454 { 2417 {
2455 case 1: 2418 case 1:
2456 SetCondition(0, 1); 2419 SetCondition(Condition_Cursed, 1);
2457 pAudioPlayer->PlaySound((SoundID)221, 0, 0, -1, 0, 0, 0, 0); 2420 pAudioPlayer->PlaySound((SoundID)221, 0, 0, -1, 0, 0, 0, 0);
2458 do
2459 {
2460 if ( this == pPlayers[v3 + 1] )
2461 break;
2462 ++v3;
2463 }
2464 while ( v3 < 4 );
2465 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); 2421 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
2466 return 1; 2422 return 1;
2467 break; 2423 break;
2468 case 2: 2424 case 2:
2469 SetCondition(1, 1); 2425 SetCondition(Condition_Weak, 1);
2470 pAudioPlayer->PlaySound((SoundID)221, 0, 0, -1, 0, 0, 0, 0); 2426 pAudioPlayer->PlaySound((SoundID)221, 0, 0, -1, 0, 0, 0, 0);
2471 do
2472 {
2473 if ( this == pPlayers[v3 + 1] )
2474 break;
2475 ++v3;
2476 }
2477 while ( v3 < 4 );
2478 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); 2427 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
2479 return 1; 2428 return 1;
2480 break; 2429 break;
2481 case 3: 2430 case 3:
2482 SetCondition(2, 1); 2431 SetCondition(Condition_Sleep, 1);
2483 pAudioPlayer->PlaySound((SoundID)221, 0, 0, -1, 0, 0, 0, 0); 2432 pAudioPlayer->PlaySound((SoundID)221, 0, 0, -1, 0, 0, 0, 0);
2484 do
2485 {
2486 if ( this == pPlayers[v3 + 1] )
2487 break;
2488 ++v3;
2489 }
2490 while ( v3 < 4 );
2491 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); 2433 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
2492 return 1; 2434 return 1;
2493 break; 2435 break;
2494 case 23: 2436 case 23:
2495 SetCondition(3, 1); 2437 SetCondition(Condition_Fear, 1);
2496 pAudioPlayer->PlaySound((SoundID)221, 0, 0, -1, 0, 0, 0, 0); 2438 pAudioPlayer->PlaySound((SoundID)221, 0, 0, -1, 0, 0, 0, 0);
2497 do
2498 {
2499 if ( this == pPlayers[v3 + 1] )
2500 break;
2501 ++v3;
2502 }
2503 while ( v3 < 4 );
2504 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); 2439 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
2505 return 1; 2440 return 1;
2506 break; 2441 break;
2507 case 4: 2442 case 4:
2508 SetCondition(4, 1); 2443 SetCondition(Condition_Drunk, 1);
2509 pAudioPlayer->PlaySound((SoundID)221, 0, 0, -1, 0, 0, 0, 0); 2444 pAudioPlayer->PlaySound((SoundID)221, 0, 0, -1, 0, 0, 0, 0);
2510 do
2511 {
2512 if ( this == pPlayers[v3 + 1] )
2513 break;
2514 ++v3;
2515 }
2516 while ( v3 < 4 );
2517 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); 2445 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
2518 return 1; 2446 return 1;
2519 break; 2447 break;
2520 case 5: 2448 case 5:
2521 SetCondition(5, 1); 2449 SetCondition(Condition_Insane, 1);
2522 pAudioPlayer->PlaySound((SoundID)224, 0, 0, -1, 0, 0, 0, 0); 2450 pAudioPlayer->PlaySound((SoundID)224, 0, 0, -1, 0, 0, 0, 0);
2523 do
2524 {
2525 if ( this == pPlayers[v3 + 1] )
2526 break;
2527 ++v3;
2528 }
2529 while ( v3 < 4 );
2530 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); 2451 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
2531 return 1; 2452 return 1;
2532 break; 2453 break;
2533 case 6: 2454 case 6:
2534 SetCondition(6, 1); 2455 SetCondition(Condition_Poison1, 1);
2535 pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0); 2456 pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0);
2536 do
2537 {
2538 if ( this == pPlayers[v3 + 1] )
2539 break;
2540 ++v3;
2541 }
2542 while ( v3 < 4 );
2543 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); 2457 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
2544 return 1; 2458 return 1;
2545 break; 2459 break;
2546 case 7: 2460 case 7:
2547 SetCondition(8, 1); 2461 SetCondition(Condition_Poison2, 1);
2548 pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0); 2462 pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0);
2549 do
2550 {
2551 if ( this == pPlayers[v3 + 1] )
2552 break;
2553 ++v3;
2554 }
2555 while ( v3 < 4 );
2556 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); 2463 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
2557 return 1; 2464 return 1;
2558 break; 2465 break;
2559 case 8: 2466 case 8:
2560 SetCondition(10, 1); 2467 SetCondition(Condition_Poison3, 1);
2561 pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0); 2468 pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0);
2562 do
2563 {
2564 if ( this == pPlayers[v3 + 1] )
2565 break;
2566 ++v3;
2567 }
2568 while ( v3 < 4 );
2569 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); 2469 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
2570 return 1; 2470 return 1;
2571 break; 2471 break;
2572 case 9: 2472 case 9:
2573 SetCondition(11, 1); 2473 SetCondition(Condition_Disease3, 1);
2574 pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0); 2474 pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0);
2575 do
2576 {
2577 if ( this == pPlayers[v3 + 1] )
2578 break;
2579 ++v3;
2580 }
2581 while ( v3 < 4 );
2582 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); 2475 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
2583 return 1; 2476 return 1;
2584 break; 2477 break;
2585 case 12: 2478 case 12:
2586 SetCondition(12, 1); 2479 SetCondition(Condition_Paralyzed, 1);
2587 pAudioPlayer->PlaySound((SoundID)224, 0, 0, -1, 0, 0, 0, 0); 2480 pAudioPlayer->PlaySound((SoundID)224, 0, 0, -1, 0, 0, 0, 0);
2588 do
2589 {
2590 if ( this == pPlayers[v3 + 1] )
2591 break;
2592 ++v3;
2593 }
2594 while ( v3 < 4 );
2595 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); 2481 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
2596 return 1; 2482 return 1;
2597 break; 2483 break;
2598 case 15: 2484 case 15:
2599 SetCondition(15, 1); 2485 SetCondition(Condition_Pertified, 1);
2600 pAudioPlayer->PlaySound((SoundID)225, 0, 0, -1, 0, 0, 0, 0); 2486 pAudioPlayer->PlaySound((SoundID)225, 0, 0, -1, 0, 0, 0, 0);
2601 do
2602 {
2603 if ( this == pPlayers[v3 + 1] )
2604 break;
2605 ++v3;
2606 }
2607 while ( v3 < 4 );
2608 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); 2487 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
2609 return 1; 2488 return 1;
2610 break; 2489 break;
2611 case 13: 2490 case 13:
2612 SetCondition(13, 1); 2491 SetCondition(Condition_Unconcious, 1);
2613 pAudioPlayer->PlaySound((SoundID)224, 0, 0, -1, 0, 0, 0, 0); 2492 pAudioPlayer->PlaySound((SoundID)224, 0, 0, -1, 0, 0, 0, 0);
2614 do
2615 {
2616 if ( this == pPlayers[v3 + 1] )
2617 break;
2618 ++v3;
2619 }
2620 while ( v3 < 4 );
2621 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); 2493 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
2622 return 1; 2494 return 1;
2623 break; 2495 break;
2624 case 14: 2496 case 14:
2625 SetCondition(14, 1); 2497 SetCondition(Condition_Dead, 1);
2626 pAudioPlayer->PlaySound((SoundID)225, 0, 0, -1, 0, 0, 0, 0); 2498 pAudioPlayer->PlaySound((SoundID)225, 0, 0, -1, 0, 0, 0, 0);
2627 do
2628 {
2629 if ( this == pPlayers[v3 + 1] )
2630 break;
2631 ++v3;
2632 }
2633 while ( v3 < 4 );
2634 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); 2499 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
2635 return 1; 2500 return 1;
2636 break; 2501 break;
2637 case 16: 2502 case 16:
2638 SetCondition(16, 1); 2503 SetCondition(Condition_Eradicated, 1);
2639 pAudioPlayer->PlaySound((SoundID)225, 0, 0, -1, 0, 0, 0, 0); 2504 pAudioPlayer->PlaySound((SoundID)225, 0, 0, -1, 0, 0, 0, 0);
2640 do
2641 {
2642 if ( this == pPlayers[v3 + 1] )
2643 break;
2644 ++v3;
2645 }
2646 while ( v3 < 4 );
2647 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); 2505 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
2648 return 1; 2506 return 1;
2649 break; 2507 break;
2650 case 17: 2508 case 17:
2651 case 18: 2509 case 18:
2652 case 19: 2510 case 19:
2653 if ( *(char *)(v48 + 21) & 2 ) 2511 if ( v48->uAttributes & ITEM_ENCHANTED )
2654 { 2512 {
2655 do
2656 {
2657 if ( this == pPlayers[v3 + 1] )
2658 break;
2659 ++v3;
2660 }
2661 while ( v3 < 4 );
2662 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); 2513 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
2663 return 1; 2514 return 1;
2664 } 2515 }
2665 PlaySound(SPEECH_40, 0); 2516 PlaySound(SPEECH_40, 0);
2666 *(int *)(v48 + 20) |= 2u; 2517 v48->SetBroken();
2667 pAudioPlayer->PlaySound((SoundID)47, 0, 0, -1, 0, 0, 0, 0); 2518 pAudioPlayer->PlaySound((SoundID)47, 0, 0, -1, 0, 0, 0, 0);
2668 do
2669 {
2670 if ( this == pPlayers[v3 + 1] )
2671 break;
2672 ++v3;
2673 }
2674 while ( v3 < 4 );
2675 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); 2519 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
2676 return 1; 2520 return 1;
2677 break; 2521 break;
2678 case 20: 2522 case 20:
2679 PlaySound(SPEECH_40, 0); 2523 PlaySound(SPEECH_40, 0);
2681 if ( pActor->array_000234[0].uItemID ) 2525 if ( pActor->array_000234[0].uItemID )
2682 { 2526 {
2683 v27 = &pActor->array_000234[1]; 2527 v27 = &pActor->array_000234[1];
2684 if ( pActor->array_000234[1].uItemID ) 2528 if ( pActor->array_000234[1].uItemID )
2685 { 2529 {
2686 do
2687 {
2688 if ( this == pPlayers[v3 + 1] )
2689 break;
2690 ++v3;
2691 }
2692 while ( v3 < 4 );
2693 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); 2530 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
2694 return 1; 2531 return 1;
2695 } 2532 }
2696 } 2533 }
2697 memcpy(v27, &this->pInventoryItemList[this->pInventoryMatrix[v47]-1], 0x24u); 2534 memcpy(v27, &this->pInventoryItemList[this->pInventoryMatrix[v47]-1], 0x24u);
2698 RemoveItemAtInventoryIndex(v47); 2535 RemoveItemAtInventoryIndex(v47);
2699 pAudioPlayer->PlaySound((SoundID)47, 0, 0, -1, 0, 0, 0, 0); 2536 pAudioPlayer->PlaySound((SoundID)47, 0, 0, -1, 0, 0, 0, 0);
2700 do
2701 {
2702 if ( this == pPlayers[v3 + 1] )
2703 break;
2704 ++v3;
2705 }
2706 while ( v3 < 4 );
2707 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); 2537 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
2708 return 1; 2538 return 1;
2709 break; 2539 break;
2710 case 21: 2540 case 21:
2711 PlaySound(SPEECH_42, 0); 2541 PlaySound(SPEECH_42, 0);
2712 ++this->sAgeModifier; 2542 ++this->sAgeModifier;
2713 pAudioPlayer->PlaySound((SoundID)226, 0, 0, -1, 0, 0, 0, 0); 2543 pAudioPlayer->PlaySound((SoundID)226, 0, 0, -1, 0, 0, 0, 0);
2714 do
2715 {
2716 if ( this == pPlayers[v3 + 1] )
2717 break;
2718 ++v3;
2719 }
2720 while ( v3 < 4 );
2721 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); 2544 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
2722 return 1; 2545 return 1;
2723 break; 2546 break;
2724 case 22: 2547 case 22:
2725 PlaySound(SPEECH_41, 0); 2548 PlaySound(SPEECH_41, 0);
2726 this->sMana = 0; 2549 this->sMana = 0;
2727 pAudioPlayer->PlaySound((SoundID)226, 0, 0, -1, 0, 0, 0, 0); 2550 pAudioPlayer->PlaySound((SoundID)226, 0, 0, -1, 0, 0, 0, 0);
2728 do
2729 {
2730 if ( this == pPlayers[v3 + 1] )
2731 break;
2732 ++v3;
2733 }
2734 while ( v3 < 4 );
2735 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); 2551 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
2736 return 1; 2552 return 1;
2737 break; 2553 break;
2738 default: 2554 default:
2739 return 0; 2555 return 0;
2740 } 2556 }
2741 } 2557 }
2742 return result;
2743 } 2558 }
2744 2559
2745 // 48DCF6: using guessed type char var_94[140]; 2560 // 48DCF6: using guessed type char var_94[140];
2746 2561
2747 //----- (0048E1A3) -------------------------------------------------------- 2562 //----- (0048E1A3) --------------------------------------------------------