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

◆ RedirectToHandEvent()

bool HumanInventory::RedirectToHandEvent ( InventoryMode mode,
notnull InventoryLocation src,
notnull InventoryLocation dst )
inlineprivate

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

201 {
202 if (src.GetType() == InventoryLocationType.HANDS)
203 {
204 Man man_src = Man.Cast(src.GetParent());
205 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HI::RedirectToHandEvent - source location == HANDS, player has to handle this");
206
207 EntityAI item = src.GetItem();
208
209 int r_index = FindUserReservedLocationIndex(item);
210
211 if (r_index >= 0)
212 {
213 InventoryLocation r_il = new InventoryLocation();
214 GetUserReservedLocation(r_index,r_il);
215
217 int r_type = r_il.GetType();
218 if (r_type == InventoryLocationType.CARGO || r_type == InventoryLocationType.PROXYCARGO)
219 {
220 r_il.GetParent().GetOnReleaseLock().Invoke(item);
221 }
222 else if (r_type == InventoryLocationType.ATTACHMENT)
223 {
224 r_il.GetParent().GetOnAttachmentReleaseLock().Invoke(item, r_il.GetSlot());
225 }
226 }
227
228 man_src.GetHumanInventory().HandEvent(mode, new HandEventMoveTo(man_src, src, dst));
229 return true;
230 }
231
232 if (dst.GetType() == InventoryLocationType.HANDS)
233 {
234 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HI::RedirectToHandEvent - dst location == HANDS, player has to handle this");
235
236 Man man_dst = Man.Cast(dst.GetParent());
237 man_dst.GetHumanInventory().HandEvent(mode, new HandEventTake(man_dst, src));
238 return true;
239 }
240 return false;
241 }
class LogManager EntityAI
void hndDebugPrint(string s)
Определения HandFSM.c:1
InventoryLocationType
types of Inventory Location
Определения InventoryLocation.c:4
proto native int FindUserReservedLocationIndex(notnull EntityAI e)
proto native void GetUserReservedLocation(int index, out notnull InventoryLocation dst)
proto native bool ClearUserReservedLocationAtIndex(int index)
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetType()
returns type of InventoryLocation

Перекрестные ссылки ClearUserReservedLocationAtIndex(), FindUserReservedLocationIndex(), InventoryLocation::GetParent(), InventoryLocation::GetSlot(), InventoryLocation::GetType(), GetUserReservedLocation(), hndDebugPrint() и LogManager::IsInventoryHFSMLogEnable().

Используется в TakeEntityToInventory() и TakeToDst().