DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ CanCombine()

override bool AttachmentCategoriesRow::CanCombine ( )
inlineprotected

См. определение в файле AttachmentCategoriesRow.c строка 236

237 {
238 Man player = GetGame().GetPlayer();
239 ItemBase prev_item = ItemBase.Cast( GetFocusedItem() );
240 ItemBase selected_item = ItemBase.Cast( player.GetHumanInventory().GetEntityInHands() );
241 SlotsIcon focused_icon = GetFocusedSlotsIcon();
242
243 if( selected_item )
244 {
245 int selected_slot = GetFocusedSlot();
246 int stack_max;
247 if( selected_item && selected_item.GetInventory().CanRemoveEntity() && (focused_icon && !focused_icon.IsOutOfReach()) )
248 {
249 if( m_Entity.GetInventory().CanAddAttachmentEx( selected_item, selected_slot ) )
250 {
251 stack_max = InventorySlots.GetStackMaxForSlotId( selected_slot );
252 float quantity = selected_item.GetQuantity();
253 if( stack_max == 0 || stack_max >= quantity || !selected_item.CanBeSplit() )
254 {
255 return true;
256 }
257 else
258 {
259 return true;
260 }
261 }
262 else if( selected_slot != -1 )
263 {
264 if( prev_item )
265 {
266 InventoryLocation inv_loc = new InventoryLocation;
267 prev_item.GetInventory().GetCurrentInventoryLocation( inv_loc );
268 stack_max = InventorySlots.GetStackMaxForSlotId( inv_loc.GetSlot() );
269 quantity = prev_item.GetQuantity();
270 if( prev_item.CanBeCombined( ItemBase.Cast( selected_item ) ) )
271 {
272 return true;
273 }
274 }
275 }
276 }
277 }
278 return false;
279 }
EntityAI m_Entity
Определения ActionDebug.c:11
class GP5GasMask extends MaskBase ItemBase
proto native DayZPlayer GetPlayer()
proto native int GetSlot()
returns slot id if current type is Attachment
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
Определения Rag.c:61
override bool CanBeSplit()
Определения Rag.c:34
bool IsOutOfReach()
Определения SlotsIcon.c:729
proto native CGame GetGame()

Перекрестные ссылки ItemBase::CanBeCombined(), ItemBase::CanBeSplit(), GetFocusedSlot(), GetGame(), CGame::GetPlayer(), InventoryLocation::GetSlot(), InventorySlots::GetStackMaxForSlotId(), SlotsIcon::IsOutOfReach() и m_Entity.

Используется в Combine().