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

◆ RedirectToHandEvent()

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

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

193 {
194 if (src.GetType() == InventoryLocationType.HANDS)
195 {
196 Man man_src = Man.Cast(src.GetParent());
197 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HI::RedirectToHandEvent - source location == HANDS, player has to handle this");
198
199 EntityAI item = src.GetItem();
200
201 int r_index = FindUserReservedLocationIndex(item);
202
203 if (r_index >= 0)
204 {
205 InventoryLocation r_il = new InventoryLocation();
206 GetUserReservedLocation(r_index,r_il);
207
209 int r_type = r_il.GetType();
210 if (r_type == InventoryLocationType.CARGO || r_type == InventoryLocationType.PROXYCARGO)
211 {
212 r_il.GetParent().GetOnReleaseLock().Invoke(item);
213 }
214 else if (r_type == InventoryLocationType.ATTACHMENT)
215 {
216 r_il.GetParent().GetOnAttachmentReleaseLock().Invoke(item, r_il.GetSlot());
217 }
218 }
219
220 man_src.GetHumanInventory().HandEvent(mode, new HandEventMoveTo(man_src, src, dst));
221 return true;
222 }
223
224 if (dst.GetType() == InventoryLocationType.HANDS)
225 {
226 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HI::RedirectToHandEvent - dst location == HANDS, player has to handle this");
227
228 Man man_dst = Man.Cast(dst.GetParent());
229 man_dst.GetHumanInventory().HandEvent(mode, new HandEventTake(man_dst, src));
230 return true;
231 }
232 return false;
233 }
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().