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

◆ BuildCondition() [2/2]

static bool BuildCondition ( PlayerBase player,
ActionTarget target,
ItemBase item,
bool camera_check,
int constraction_index )
staticprotected

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

1017 {
1018 EntityAI ent = EntityAI.Cast(target.GetObject());
1019 if (ent && ent.CanUseConstruction())
1020 {
1021 ConstructionActionData constructionActionData = player.GetConstructionActionData();
1022 constructionActionData.SetTarget(ent);
1023
1024 ConstructionPart part;
1025 if (item)
1026 {
1027 part = constructionActionData.GetBuildPartAtIndex(constraction_index);
1028 }
1029 else
1030 {
1031 part = constructionActionData.GetBuildPartHandsGenericAtIndex(constraction_index);
1032 }
1033
1034 if (part)
1035 {
1036 //camera and position checks
1037
1038 BaseBuildingBase baseBuilding;
1039 if (Class.CastTo(baseBuilding,ent) && baseBuilding.MustBeBuiltFromOutside() && baseBuilding.IsPlayerInsideEx(player, part.GetMainPartName()))
1040 return false;
1041
1042 //Camera check (client-only)
1043 if (camera_check && !GetGame().IsDedicatedServer())
1044 {
1045 if (ent.IsFacingCamera(part.GetMainPartName()))
1046 return false;
1047 }
1048
1049 return !player.GetInputController().CameraIsFreeLook();
1050 }
1051 }
1052
1053 return false;
1054 }
override bool MustBeBuiltFromOutside()
Определения ShelterSite.c:80
Определения Fence.c:2
Super root of all classes in Enforce script.
Определения EnScript.c:11
ConstructionPart GetBuildPartHandsGenericAtIndex(int idx)
Определения ConstructionActionData.c:364
void SetTarget(Object target)
Определения ConstructionActionData.c:111
ConstructionPart GetBuildPartAtIndex(int idx)
Определения ConstructionActionData.c:346
string GetMainPartName()
Определения ConstructionPart.c:203
Instanced construction part data classes for dynamic data, statics now stored on EntityType level in ...
Определения ConstructionPart.c:4
DayZGame GetGame()
Определения gameplay.c:636
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки ActionTarget(), Class::CastTo(), ConstructionActionData::GetBuildPartAtIndex(), ConstructionActionData::GetBuildPartHandsGenericAtIndex(), GetGame(), ConstructionPart::GetMainPartName(), BaseBuildingBase::MustBeBuiltFromOutside() и ConstructionActionData::SetTarget().

Используется в ComplexBuildCollideCheckClient().