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

◆ PlayerCheckSwapItemsRequest()

bool PlayerCheckSwapItemsRequest ( notnull InventoryLocation src1,
notnull InventoryLocation src2,
notnull InventoryLocation dst1,
notnull InventoryLocation dst2,
float radius )
protected

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

4778 {
4779 bool result = true;
4780
4781 EntityAI ent = dst1.GetParent();
4782 PlayerBase player;
4783 if ( ent )
4784 {
4785 player = PlayerBase.Cast(ent.GetHierarchyRootPlayer());
4786 if (player)
4787 {
4788 if ( GetDayZPlayerOwner() != player )
4789 {
4790 if (player.IsAlive())
4791 {
4792 if (!player.IsRestrained() && !player.IsUnconscious())
4793 {
4794 return false;
4795 }
4796 }
4797 }
4798 }
4799 }
4800
4801 ent = dst2.GetParent();
4802 if ( ent )
4803 {
4804 player = PlayerBase.Cast(ent.GetHierarchyRootPlayer());
4805 if (player)
4806 {
4807 if ( GetDayZPlayerOwner() != player )
4808 {
4809 if (player.IsAlive())
4810 {
4811 if (!player.IsRestrained() && !player.IsUnconscious())
4812 {
4813 return false;
4814 }
4815 }
4816 }
4817 }
4818 }
4819
4820
4821 if ( result )
4822 {
4823 result = CheckSwapItemsRequest( GetManOwner(), src1, src2, dst1, dst2, GameInventory.c_MaxItemDistanceRadius);
4824 }
4825
4826 EntityAI item;
4827 EntityAI root;
4828
4829 if (result)
4830 {
4831 item = dst1.GetItem().GetHierarchyRoot();
4832 root = item.GetHierarchyRoot();
4833
4834 result = vector.Distance(GetManOwner().GetPosition(), item.GetPosition()) < (radius + root.GetCollisionRadius());
4835 }
4836
4837 if (result)
4838 {
4839 item = dst2.GetItem().GetHierarchyRoot();
4840 root = item.GetHierarchyRoot();
4841
4842 result = vector.Distance(GetManOwner().GetPosition(), item.GetPosition()) < (radius + root.GetCollisionRadius());
4843 }
4844
4845 return result;
4846
4847 }
DayZPlayer GetDayZPlayerOwner()
Определения DayZPlayerInventory.c:170
const float c_MaxItemDistanceRadius
anti-cheats
script counterpart to engine's class Inventory
Определения PlayerBaseClient.c:2
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
Определения EnConvert.c:119
vector GetPosition()
Get the world position of the Effect.
Определения Effect.c:473

Перекрестные ссылки GameInventory::c_MaxItemDistanceRadius, vector::Distance(), GetDayZPlayerOwner() и GetPosition().

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