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

◆ UnlockOnServer()

void DigitalCodeLock::UnlockOnServer ( EntityAI parent)
inlineprotected

Unlock AND drop.

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

278 {
279 InventoryLocation inventoryLocation = new InventoryLocation;
280 GetInventory().GetCurrentInventoryLocation(inventoryLocation);
281
282 //drop entity from attachment slot
283 if (g_Game.IsMultiplayer())
284 {
285 parent.GetInventory().DropEntity(InventoryMode.SERVER, parent, this);
286 }
287 else
288 {
289 parent.GetInventory().DropEntity(InventoryMode.LOCAL, parent, this);
290 }
291
292 vector groundPos;
293 string slotName = InventorySlots.GetSlotName(inventoryLocation.GetSlot());
294 if (parent.MemoryPointExists(slotName))
295 {
296 groundPos = parent.ModelToWorld(parent.GetMemoryPointPos(slotName));
297 }
298 else
299 {
300 groundPos = GetPosition();
301 }
302
303 SetPosition(groundPos);
304 PlaceOnSurface();
305 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
PlayerSpawnPreset slotName
DayZGame g_Game
Определения DayZGame.c:4074
proto native int GetSlot()
returns slot id if current type is Attachment
proto native void SetPosition(vector position)
Set the world position of the Effect.
Определения Effect.c:463
vector GetPosition()
Get the world position of the Effect.
Определения Effect.c:473

Перекрестные ссылки g_Game, GetPosition(), InventoryLocation::GetSlot(), InventorySlots::GetSlotName(), SetPosition() и slotName.

Используется в BaseBuildingBase::HandleDropAttachment() и BaseBuildingBase::OnPartDismantledServer().