| 425 | } |
| 426 | |
| 427 | bool CInventory::Ruck(PIItem pIItem) |
| 428 | { |
| 429 | if (!CanPutInRuck(pIItem)) |
| 430 | return false; |
| 431 | |
| 432 | bool in_slot = InSlot(pIItem); |
| 433 | //вещь была в слоте |
| 434 | if (in_slot) |
| 435 | { |
| 436 | if (m_iActiveSlot == pIItem->GetSlot()) |
| 437 | Activate(NO_ACTIVE_SLOT); |
| 438 | m_slots[pIItem->GetSlot()].m_pIItem = NULL; |
| 439 | } |
| 440 | else |
| 441 | { |
| 442 | //вещь была на поясе или вообще только поднята с земли |
| 443 | TIItemContainer::iterator it = std::find(m_belt.begin(), m_belt.end(), pIItem); |
| 444 | if (m_belt.end() != it) |
| 445 | m_belt.erase(it); |
| 446 | } |
| 447 | |
| 448 | m_ruck.insert(m_ruck.end(), pIItem); |
| 449 | |
| 450 | CalcTotalWeight(); |
| 451 | InvalidateState(); |
| 452 | |
| 453 | EItemPlace prevPlace = pIItem->m_eItemPlace; |
| 454 | m_pOwner->OnItemRuck(pIItem, prevPlace); |
| 455 | pIItem->m_eItemPlace = eItemPlaceRuck; |
| 456 | |
| 457 | if (pIItem->GetSlot() != OUTFIT_SLOT || (smart_cast<CActor*>(GetOwner()) && in_slot)) //фикс сброса визуала актора при взятии в инвентарь любого костюма |
| 458 | pIItem->OnMoveToRuck(prevPlace); |
| 459 | else |
| 460 | pIItem->CInventoryItem::OnMoveToRuck(prevPlace); |
| 461 | |
| 462 | if (in_slot) |
| 463 | pIItem->object().processing_deactivate(); |
| 464 | |
| 465 | return true; |
| 466 | } |
| 467 | |
| 468 | void CInventory::Activate_deffered(u32 slot, u32 _frame) |
| 469 | { |
no test coverage detected