If there is a missmatch between surface y and surface road y we assume owner is bellow or above terrain level and replace the position y with the surface road y
6742 {
6744 {
6746 float surfaceY =
g_Game.SurfaceY(pos[0], pos[2]);
6747 float roadY =
g_Game.SurfaceRoadY(pos[0], pos[2]);
6748 float diffY = surfaceY - roadY;
6749
6750 if (diffY > 0)
6751 {
6754 if (surfaceY != roadY)
6755 {
6756 pos[1] = roadY;
6757 }
6758 }
6759 else
6760 {
6762 diffY = surfaceY - ownerY;
6763 if (diffY > 0)
6764 {
6766 pos[1] = ownerY + 0.05;
6767 }
6768 }
6769
6770 bool is_AI =
g_Game.IsKindOf(object_name,
"DZ_LightAI");
6771 if (is_AI)
6772 {
6773 return SpawnAI(object_name, pos);
6774 }
6775 else
6776 {
6777 InventoryLocation inv_loc = new InventoryLocation;
6778 vector mtx[4];
6779 Math3D.MatrixIdentity4(mtx);
6780 mtx[3] = pos;
6782
6784 #ifdef DEVELOPER
6785 if (
g_Game.IsKindOf(object_name,
"Boat"))
6787 #endif
6788
6790 }
6791 }
6792 return null;
6793 }
const int ECE_PLACE_ON_SURFACE
proto native vector GetPos()
returns position of item in world if type is Ground
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
EntityAI SpawnAI(string object_name, vector pos)
DayZPlayerInstanceType
defined in C++
proto native DayZPlayerInstanceType GetInstanceType()
vector GetPosition()
Get the world position of the Effect.