Jump to content
T. Miller

Need help fixing a bug!

Recommended Posts

I found a easier fix using the last pieces of code you send:

/*
	@file_name: fn_unitCreate.sqf
	@file_edit: 11/06/2016
	@file_description: ...
*/

private ["_unitType","_unitLoc","_unitList","_unitName","_unitStats","_unit"];
_unitType = (_this select 0) select 0;
_unitLoc = (_this select 0) select 1;
_unitList = missionNameSpace getVariable "A3A_unitList";

_unitName = [] call A3A_fnc_unitAssignName;
_unitStats = _unitList select 1 select (_unitList select 0 find _unitType);
_unit = [_unitName, _unitLoc];

{
	_unit pushBack +_x;
} foreach _unitStats;

_unit;

Share this post


Link to post
Share on other sites

Now you copy everything indiscriminately, it needs to be copied or not. It is better to compose unit record manually, as I showed in the example above.

 

UPD: Only attributes of unit that changing during mission should be copied to unit instance. Constant attributes should be accessed anywhere from unit reference

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×