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

◆ CanCombine()

override bool AttachmentCategoriesRow::CanCombine ( )
inlineprotected

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

237 {
238 Man player = g_Game.GetPlayer();
239 ItemBase prev_item = ItemBase.Cast(GetFocusedItem());
240 ItemBase selected_item = ItemBase.Cast( player.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 }
Entity m_Entity
Определения CachedEquipmentStorageBase.c:16
DayZGame g_Game
Определения DayZGame.c:4074
class GP5GasMask extends MaskBase ItemBase
proto native GameInventory GetInventory()
proto native bool CanAddAttachmentEx(notnull EntityAI e, int slot)
Check if attachment can be added to slot @NOTE: Note that slot index IS NOT slot ID!...
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()
Определения SlotsIconBase.c:700

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

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