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

◆ ThrowEntity()

bool HumanInventory::ThrowEntity ( EntityAI item,
vector dir,
float force )
inlineprivate

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

165 {
166 if (g_Game.IsServer() && g_Game.IsMultiplayer())
167 return false;
168
169 DayZPlayer player = DayZPlayer.Cast(item.GetHierarchyRootPlayer());
170 InventoryMode invMode = InventoryMode.PREDICTIVE;
171
172 if (player.NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(), null))
173 invMode = InventoryMode.JUNCTURE;
174
175 InventoryLocation src = new InventoryLocation();
176 if (item)
177 {
178 GameInventory itemInventory = item.GetInventory();
179 if (itemInventory && itemInventory.GetCurrentInventoryLocation(src))
180 {
181 switch (src.GetType())
182 {
183 case InventoryLocationType.HANDS:
184 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::ThrowEntity item=" + item);
185 HandEventThrow throwEvent = new HandEventThrow(GetManOwner(), src);
186 throwEvent.SetForce(dir * force);
187 HandEvent(invMode, throwEvent);
188 return true;
189
190 default:
191 DropEntity(invMode, player, item);
192 return true;
193 }
194 }
195 }
196 Error("No inventory location");
197 return false;
198 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
DayZGame g_Game
Определения DayZGame.c:3942
void hndDebugPrint(string s)
Определения HandFSM.c:1
InventoryLocationType
types of Inventory Location
Определения InventoryLocation.c:4
proto native bool GetCurrentInventoryLocation(out notnull InventoryLocation loc)
returns information about current item location
Man GetManOwner()
Определения HumanInventory.c:102
bool HandEvent(InventoryMode mode, HandEventBase e)
Определения HumanInventory.c:134
override bool DropEntity(InventoryMode mode, EntityAI owner, notnull EntityAI item)
Определения HumanInventory.c:139
proto native int GetType()
returns type of InventoryLocation
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90

Перекрестные ссылки DropEntity(), Error(), g_Game, GameInventory::GetCurrentInventoryLocation(), GetManOwner(), InventoryLocation::GetType(), HandEvent(), hndDebugPrint() и LogManager::IsInventoryHFSMLogEnable().