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

◆ PlayerCheckSwapItemsRequest()

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

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

2948 {
2949 bool result = true;
2950
2951 EntityAI ent = dst1.GetParent();
2952 PlayerBase player;
2953 if ( ent )
2954 {
2955 player = PlayerBase.Cast(ent.GetHierarchyRootPlayer());
2956 if (player)
2957 {
2958 if ( GetDayZPlayerOwner() != player )
2959 {
2960 if (player.IsAlive())
2961 {
2962 if (!player.IsRestrained() && !player.IsUnconscious())
2963 {
2964 return false;
2965 }
2966 }
2967 }
2968 }
2969 }
2970
2971 ent = dst2.GetParent();
2972 if ( ent )
2973 {
2974 player = PlayerBase.Cast(ent.GetHierarchyRootPlayer());
2975 if (player)
2976 {
2977 if ( GetDayZPlayerOwner() != player )
2978 {
2979 if (player.IsAlive())
2980 {
2981 if (!player.IsRestrained() && !player.IsUnconscious())
2982 {
2983 return false;
2984 }
2985 }
2986 }
2987 }
2988 }
2989
2990
2991 if ( result )
2992 {
2993 result = CheckSwapItemsRequest( GetManOwner(), src1, src2, dst1, dst2, GameInventory.c_MaxItemDistanceRadius);
2994 }
2995
2996 EntityAI item;
2997 EntityAI root;
2998
2999 if (result)
3000 {
3001 item = dst1.GetItem().GetHierarchyRoot();
3002 root = item.GetHierarchyRoot();
3003
3004 result = vector.Distance(GetManOwner().GetPosition(), item.GetPosition()) < (radius + root.GetCollisionRadius());
3005 }
3006
3007 if (result)
3008 {
3009 item = dst2.GetItem().GetHierarchyRoot();
3010 root = item.GetHierarchyRoot();
3011
3012 result = vector.Distance(GetManOwner().GetPosition(), item.GetPosition()) < (radius + root.GetCollisionRadius());
3013 }
3014
3015 return result;
3016
3017 }
DayZPlayer GetDayZPlayerOwner()
Определения DayZPlayerInventory.c:167
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().