MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / Ruck

Method Ruck

ogsr_engine/xrGame/Inventory.cpp:427–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425}
426
427bool 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
468void CInventory::Activate_deffered(u32 slot, u32 _frame)
469{

Callers 12

DieMethod · 0.45
OnEventMethod · 0.45
PutNextToSlotMethod · 0.45
TrySwitchGrenadeMethod · 0.45
initializeMethod · 0.45
executeMethod · 0.45
MoveToRuckMethod · 0.45
initializeMethod · 0.45
executeMethod · 0.45
UpdateOutfitMethod · 0.45
ToBagMethod · 0.45
ActivatePropertiesBoxMethod · 0.45

Calls 11

InvalidateStateFunction · 0.85
findFunction · 0.50
GetSlotMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45
insertMethod · 0.45
OnItemRuckMethod · 0.45
OnMoveToRuckMethod · 0.45
processing_deactivateMethod · 0.45
objectMethod · 0.45

Tested by

no test coverage detected