code optimization, bugs, improvements

This commit is contained in:
raymix
2014-08-21 06:23:42 +01:00
parent 740f4144f1
commit 903f5d8572
7 changed files with 67 additions and 85 deletions

View File

@@ -1,5 +1,5 @@
//create an object for default build system style
private ["_passArray","_classname","_enableGhost","_ghost","_location","_location1","_dir","_object","_position","_objectHelper","_helperColor"];
private ["_passArray","_classname","_enableGhost","_ghost","_location1","_dir","_object","_objectHelper","_helperColor"];
_classname = _this select 0;
_ghost = _this select 1;
@@ -7,11 +7,10 @@ _offset = _this select 2;
_enableGhost = _this select 3; //pass false trough args if not using ghost preview
_passArray = [];
_location = [0,0,0]; //create object in debug zone first
_objectHelper = objNull;
// get inital players position
_location1 = getPosATL player;
_location1 = [player] call FNC_GetPos;
// if enabled, use ghost preview where available
if (_enableGhost) then {
@@ -20,19 +19,19 @@ if (_enableGhost) then {
};
};
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"]; //object preview, not an actual object that will be built
_object = createVehicle [_classname, [0,0,0], [], 0, "CAN_COLLIDE"]; //object preview, not an actual object that will be built
_objectHelper = "Sign_sphere10cm_EP1" createVehicle _location;
_objectHelper = "Sign_sphere10cm_EP1" createVehicle [0,0,0];
_helperColor = "#(argb,8,8,3)color(0,0,0,0,ca)";
_objectHelper setobjecttexture [0,_helperColor];
_objectHelper attachTo [player,_offset];
_object attachTo [_objectHelper,[0,0,0]];
_position = getPosATL _objectHelper;
if (isClass (configFile >> "SnapBuilding" >> _classname)) then {
["","","",["Init",_object,_classname,_objectHelper]] spawn snap_build;
};
_passArray = [_location1,_object,_position,_objectHelper];
_passArray = [_location1,_object,_objectHelper];
_passArray //[array,obj,array]