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

◆ PredictiveMoveItemFromHandsToInventory()

void EntityAI::PredictiveMoveItemFromHandsToInventory ( )
inlineprotected

returns item to previous location, if available

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

223 {
224 if (LogManager.IsSyncLogEnable()) syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " Stash IH=" + GetHumanInventory().GetEntityInHands());
225 if (!ScriptInputUserData.CanStoreInputUserData())
226 {
227 Print("[inv] PredictiveMoveItemFromHandsToInventory input data not sent yet, cannot allow another input action");
228 return;
229 }
230
231 InventoryMode invMode = InventoryMode.PREDICTIVE;
232
233 if (NeedInventoryJunctureFromServer( GetHumanInventory().GetEntityInHands(), this, this))
234 invMode = InventoryMode.JUNCTURE;
235
237 if (GetHumanInventory().GetEntityInHands().m_OldLocation && GetHumanInventory().GetEntityInHands().m_OldLocation.IsValid())
238 {
239 InventoryLocation invLoc = new InventoryLocation;
240 GetHumanInventory().GetEntityInHands().GetInventory().GetCurrentInventoryLocation(invLoc);
241 //old location is somewhere on player
242 if (GetHumanInventory().GetEntityInHands().m_OldLocation.GetParent() && GetHumanInventory().GetEntityInHands().m_OldLocation.GetParent().GetHierarchyRootPlayer())
243 {
244 if (GetHumanInventory().LocationCanMoveEntity(invLoc, GetHumanInventory().GetEntityInHands().m_OldLocation))
245 {
246 if (GetHumanInventory().TakeToDst(invMode, invLoc,GetHumanInventory().GetEntityInHands().m_OldLocation))
247 {
249 return;
250 }
251 }
252 }
253 }
254
257 }
void syncDebugPrint(string s)
Определения Debug.c:1
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Определения Inventory.c:22
override bool TakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
Определения DayZPlayerInventory.c:1655
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:17
void UpdateInventoryMenu()
bool NeedInventoryJunctureFromServer(notnull EntityAI item, EntityAI currParent, EntityAI newParent)
Определения Man.c:155
proto native HumanInventory GetHumanInventory()
proto native EntityAI GetEntityInHands()
override bool TakeEntityToInventory(InventoryMode mode, FindInventoryLocationType flags, notnull EntityAI item)
Определения HumanInventory.c:245
override string GetDebugName()
Определения dayzplayer.c:1170
proto void Print(void var)
Prints content of variable to console/log.

Перекрестные ссылки ScriptInputUserData::CanStoreInputUserData(), GetDebugName(), HumanInventory::GetEntityInHands(), GetHumanInventory(), LogManager::IsSyncLogEnable(), NeedInventoryJunctureFromServer(), Print(), syncDebugPrint(), HumanInventory::TakeEntityToInventory(), TakeToDst() и UpdateInventoryMenu().