Should fix building issues with player sliding

The change in module_build will only fix items that d ono have an offset
set in the config.

BoundingBox can be a bit generous but the player should be able to work
with any overestimation in size.
This commit is contained in:
icomrade
2016-05-18 11:01:38 -04:00
parent 8fd4c8eb8b
commit 2889d8f010
3 changed files with 9 additions and 7 deletions

View File

@@ -624,7 +624,7 @@ class Wooden_shed_DZ: Land_Shed_wooden
scope = public;
destrType = "DestructBuilding";
//cost = 100;
offset[] = {0,2.5,1};
offset[] = {0,3,1};
armor = 800;
displayName = "Wooden Shed";
vehicleClass = "Fortifications";

View File

@@ -106,9 +106,6 @@ if (_canBuild select 0) then {
};
_offset = getArray (configFile >> "CfgVehicles" >> _classname >> "offset"); //check default distance offset, define if does not exist
if((count _offset) <= 0) then {
_offset = [0,1.5,0];
};
_objectHelper = objNull;
_isOk = true;
@@ -122,6 +119,10 @@ if (_canBuild select 0) then {
_object = createVehicle [_classname, [0,0,0], [], 0, "CAN_COLLIDE"]; //object preview, not an actual object that will be built
if((count _offset) <= 0) then {
_offset = [0,(abs(((boundingBox _object)select 0) select 1)),0];
};
_objectHelper = "Sign_sphere10cm_EP1" createVehicle [0,0,0];
_helperColor = "#(argb,8,8,3)color(0,0,0,0,ca)";
_objectHelper setobjecttexture [0,_helperColor];

View File

@@ -108,9 +108,6 @@ if (_canBuild select 0) then {
};
_offset = getArray (configFile >> "CfgVehicles" >> _classname >> "offset");
if((count _offset) <= 0) then {
_offset = [0,1.5,0];
};
_location = [0,0,0];
_isOk = true;
@@ -124,6 +121,10 @@ if (_canBuild select 0) then {
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
if((count _offset) <= 0) then {
_offset = [0,(abs(((boundingBox _object)select 0) select 1)),0];
};
_object attachTo [player,_offset];
_position = getPosATL _object;