comparison mm7_6.cpp @ 1558:30db6d265ceb

Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
author Grumpy7
date Sat, 07 Sep 2013 23:06:13 +0200
parents 9a6567c6c76c
children 9f8b3e904e14
comparison
equal deleted inserted replaced
1555:9c4cf5b07e98 1558:30db6d265ceb
293 party_finds_gold(v14, 0); 293 party_finds_gold(v14, 0);
294 viewparams->bRedrawGameUI = 1; 294 viewparams->bRedrawGameUI = 1;
295 } 295 }
296 } 296 }
297 } 297 }
298 pActor->uCarriedItemID = 1;
298 if ( pActor->uCarriedItemID ) 299 if ( pActor->uCarriedItemID )
299 { 300 {
300 Dst.Reset(); 301 Dst.Reset();
301 Dst.uItemID = pActor->uCarriedItemID; 302 Dst.uItemID = pActor->uCarriedItemID;
302 v9 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; 303 v9 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName;
316 v4 = Dst.uItemID; 317 v4 = Dst.uItemID;
317 } 318 }
318 if ( pItemsTable->pItems[v5].uEquipType == 14 && v4 != 220 ) 319 if ( pItemsTable->pItems[v5].uEquipType == 14 && v4 != 220 )
319 Dst.uEnchantmentType = 2 * rand() % 4 + 2; 320 Dst.uEnchantmentType = 2 * rand() % 4 + 2;
320 pItemsTable->SetSpecialBonus(&Dst); 321 pItemsTable->SetSpecialBonus(&Dst);
321 if ( !pParty->AddItem(&Dst) ) 322 if ( !pParty->AddItemToParty(&Dst) )
322 pParty->SetHoldingItem(&Dst); 323 pParty->SetHoldingItem(&Dst);
323 pActor->uCarriedItemID = 0; 324 pActor->uCarriedItemID = 0;
324 if ( pActor->array_000234[0].uItemID ) 325 if ( pActor->array_000234[0].uItemID )
325 { 326 {
326 if ( !pParty->AddItem(pActor->array_000234) ) 327 if ( !pParty->AddItemToParty(pActor->array_000234) )
327 { 328 {
328 sub_421B2C_PlaceInInventory_or_DropPickedItem(); 329 sub_421B2C_PlaceInInventory_or_DropPickedItem();
329 pParty->SetHoldingItem(pActor->array_000234); 330 pParty->SetHoldingItem(pActor->array_000234);
330 } 331 }
331 pActor->array_000234[0].Reset(); 332 pActor->array_000234[0].Reset();
332 } 333 }
333 if ( pActor->array_000234[1].uItemID ) 334 if ( pActor->array_000234[1].uItemID )
334 { 335 {
335 if ( !pParty->AddItem(&pActor->array_000234[1]) ) 336 if ( !pParty->AddItemToParty(&pActor->array_000234[1]) )
336 { 337 {
337 sub_421B2C_PlaceInInventory_or_DropPickedItem(); 338 sub_421B2C_PlaceInInventory_or_DropPickedItem();
338 pParty->SetHoldingItem(&pActor->array_000234[1]); 339 pParty->SetHoldingItem(&pActor->array_000234[1]);
339 } 340 }
340 pActor->array_000234[1].Reset(); 341 pActor->array_000234[1].Reset();
352 if ( v14 ) 353 if ( v14 )
353 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v11); 354 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v11);
354 else 355 else
355 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v11); 356 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v11);
356 ShowStatusBarString(pTmpBuf2.data(), 2u); 357 ShowStatusBarString(pTmpBuf2.data(), 2u);
357 if ( !pParty->AddItem(&Dst) ) 358 if ( !pParty->AddItemToParty(&Dst) )
358 pParty->SetHoldingItem(&Dst); 359 pParty->SetHoldingItem(&Dst);
359 v13 = 1; 360 v13 = 1;
360 } 361 }
361 goto LABEL_44; 362 goto LABEL_44;
362 } 363 }
372 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v10); 373 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v10);
373 else 374 else
374 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v10); 375 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v10);
375 ShowStatusBarString(pTmpBuf2.data(), 2u); 376 ShowStatusBarString(pTmpBuf2.data(), 2u);
376 v8 = pParty; 377 v8 = pParty;
377 if ( !pParty->AddItem(&Dst) ) 378 if ( !pParty->AddItemToParty(&Dst) )
378 pParty->SetHoldingItem(&Dst); 379 pParty->SetHoldingItem(&Dst);
379 v13 = 1; 380 v13 = 1;
380 LABEL_45: 381 LABEL_45:
381 if ( pActor->array_000234[0].uItemID ) 382 if ( pActor->array_000234[0].uItemID )
382 { 383 {
383 if ( !v8->AddItem(pActor->array_000234) ) 384 if ( !v8->AddItemToParty(pActor->array_000234) )
384 { 385 {
385 sub_421B2C_PlaceInInventory_or_DropPickedItem(); 386 sub_421B2C_PlaceInInventory_or_DropPickedItem();
386 v8->SetHoldingItem(pActor->array_000234); 387 v8->SetHoldingItem(pActor->array_000234);
387 v13 = 1; 388 v13 = 1;
388 } 389 }
389 pActor->array_000234[0].Reset(); 390 pActor->array_000234[0].Reset();
390 } 391 }
391 if ( pActor->array_000234[1].uItemID ) 392 if ( pActor->array_000234[1].uItemID )
392 { 393 {
393 if ( !v8->AddItem(&pActor->array_000234[1]) ) 394 if ( !v8->AddItemToParty(&pActor->array_000234[1]) )
394 { 395 {
395 sub_421B2C_PlaceInInventory_or_DropPickedItem(); 396 sub_421B2C_PlaceInInventory_or_DropPickedItem();
396 v8->SetHoldingItem(&pActor->array_000234[1]); 397 v8->SetHoldingItem(&pActor->array_000234[1]);
397 v13 = 1; 398 v13 = 1;
398 } 399 }