Skip to content

Commit 06f563f

Browse files
committed
Merge branch 'Development' of github.com:DayZMod/DayZ into Development
2 parents 54437fb + b54b0ad commit 06f563f

File tree

6 files changed

+50
-10
lines changed

6 files changed

+50
-10
lines changed

SQF/dayz_code/Configs/CfgLoot/Buildings/Military.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Military : Default
1111
"z_new_worker3",
1212
"z_new_worker4"
1313
};
14-
lootChance = 0.2;
14+
lootChance = 0.4;
1515
lootGroup = Military;
1616
};
1717

@@ -26,7 +26,7 @@ class MilitarySpecial : Military
2626
"z_new_worker3",
2727
"z_new_worker4"
2828
};
29-
lootChance = 0.1;
29+
lootChance = 0.4;
3030
lootGroup = MilitarySpecial;
3131
};
3232

SQF/dayz_code/Configs/CfgVehicles/CrashSite.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class CrashSite_RU : CrashSite
2525
{
2626
scope = public;
2727
model = "\z\addons\dayz_communityassets\crashsite\mi8\mi8_ru.p3d";
28-
lootParams[] = {{0.6, -4.5, 0}, -7, 2.5, 5, 7};
28+
lootParams[] = {{0.6, -4.5, 0}, 7, 2.5, 5, 7};
2929
};
3030

3131
class CrashSite_UN : CrashSite_RU
@@ -46,5 +46,5 @@ class CrashSite_EU : CrashSite
4646
{
4747
scope = public;
4848
model = "\z\addons\dayz_communityassets\crashsite\hc3\hc3.p3d";
49-
lootParams[] = {{-0.4, -0.5, 0}, -4, 2.5, 7.5, 7};
49+
lootParams[] = {{-0.4, -0.5, 0}, 4, 2.5, 7.5, 7};
5050
};

SQF/dayz_code/loot/spawn.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ switch (_lootInfo select 0) do
9191
_b = boundingBox _vehicle;
9292
_b = ((_b select 1) select 1) - ((_b select 0) select 1);
9393

94-
_d = Vector_Rotate(Vector_NORTH, random 360);
94+
_d = Vector_Rotate2D(Vector_NORTH, random 360);
9595

9696
_p = Vector_Subtract(_this select 1, Vector_Multiply_Fast(_d, _b));
9797
_p = Vector_SetZ(_p, Vector_Z(_p) + Vector_Z(getPosATL _vehicle));

SQF/dayz_code/util/Vector.hpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,12 @@ Author: Foxy
7676
#define Vector_FromDir(deg) ((deg) call dz_fn_vector_fromDir)
7777
#define Vector_FromDir_Fast(deg) [sin (deg), cos (deg), 0]
7878

79-
//Rotates the vector horizontally by the specified angle in degrees
80-
#define Vector_Rotate(v, deg) ([v, deg] call dz_fn_vector_rotate)
81-
#define Vector_Rotate_Fast(v, deg) [Vector_X(v) * cos (deg) - Vector_Y(v) * sin (deg), Vector_X(v) * sin (deg) + Vector_Y(v) * cos (deg), Vector_Z(v)]
79+
//Rotates the vector around the global Z (up) axis by the specified angle in degrees
80+
#define Vector_Rotate2D(v, deg) ([v, deg] call dz_fn_vector_rotate2d)
81+
#define Vector_Rotate2D_Fast(v, deg) [Vector_X(v) * cos -(deg) - Vector_Y(v) * sin -(deg), Vector_X(v) * sin -(deg) + Vector_Y(v) * cos -(deg), Vector_Z(v)]
82+
83+
//Rotates the vector around the specified axis by the specified angle in degrees, in three dimensions.
84+
#define Vector_Rotate3D(v, u, deg) ([v, u, deg] call dz_fn_vector_rotate3d)
85+
#define Vector_Rotate3D_Fast(v, u, deg) [((v)select0)*(((u)select0)^2*(1-cos(deg))+cos(deg))+((v)select1)*(((u)select0)*((u)select1)*(1-cos(deg))-((u)select2)*sin(deg))+((v)select2)*(((u)select0)*((u)select2)*(1-cos(deg))+((u)select1)*sin(deg)),((v)select0)*(((u)select1)*((u)select0)*(1-cos(deg))+((u)select2)*sin(deg))+((v)select1)*(((u)select1)^2*(1-cos(deg))+cos(deg))+((v)select2)*(((u)select1)*((u)select2)*(1-cos(deg))-((u)select0)*sin(deg)),((v)select0)*(((u)select2)*((u)select0)*(1-cos(deg))-((u)select1)*sin(deg))+((v)select1)*(((u)select2)*((u)select1)*(1-cos(deg))+((u)select0)*sin(deg))+((v)select2)*(((u)select2)^2*(1-cos(deg))+cos(deg))]
8286

8387
#endif

SQF/dayz_code/util/vector.sqf

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,40 @@ dz_fn_vector_divide = { Vector_Divide_Fast(P0, P1); };
1414
dz_fn_vector_angle = { Vector_Angle_Fast(P0, P1); };
1515
dz_fn_vector_normalize = { Vector_Normalize_Fast(_this); };
1616
dz_fn_vector_fromDir = { Vector_FromDir_Fast(_this); };
17-
dz_fn_vector_rotate = { Vector_Rotate_Fast(P0, P1); };
17+
dz_fn_vector_rotate2d = { Vector_Rotate2D_Fast(P0, P1); };
18+
19+
dz_fn_vector_rotate3d =
20+
{
21+
#define VX (_this select 0 select 0)
22+
#define VY (_this select 0 select 1)
23+
#define VZ (_this select 0 select 2)
24+
#define UX (_this select 1 select 0)
25+
#define UY (_this select 1 select 1)
26+
#define UZ (_this select 1 select 2)
27+
28+
private ["_sin", "_cos", "_icos"];
29+
_sin = sin (_this select 2);
30+
_cos = cos (_this select 2);
31+
_icos = 1 - _cos;
32+
33+
[
34+
VX * ( UX ^ 2 * _icos + _cos ) +
35+
VY * ( UX * UY * _icos - UZ * _sin ) +
36+
VZ * ( UX * UZ * _icos + UY * _sin )
37+
,
38+
VX * ( UY * UX * _icos + UZ * _sin ) +
39+
VY * ( UY ^ 2 * _icos + _cos ) +
40+
VZ * ( UY * UZ * _icos - UX * _sin )
41+
,
42+
VX * ( UZ * UX * _icos - UY * _sin ) +
43+
VY * ( UZ * UY * _icos + UX * _sin ) +
44+
VZ * ( UZ ^ 2 * _icos + _cos )
45+
]
46+
47+
#undef VX
48+
#undef VY
49+
#undef VZ
50+
#undef UX
51+
#undef UY
52+
#undef UZ
53+
};

SQF/dayz_server/compile/server_spawnCrashSites.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ _spawnCrashSite =
8484
_mag = random (_lootParams select 4);
8585
_lootPos = [((_lootParams select 2) + _mag) * sin _dir, ((_lootParams select 3) + _mag) * cos _dir, 0];
8686
_lootPos = Vector_Add(_lootPos, _lootParams select 0);
87-
_lootPos = Vector_Rotate(_lootPos, _lootParams select 1);
87+
_lootPos = Vector_Rotate2D(_lootPos, _lootParams select 1);
8888
_lootPos = _vehicle modelToWorld _lootPos;
8989
_lootPos set [2, 0];
9090

0 commit comments

Comments
 (0)