Custom formations not working for directional deploy orders.

Drawing a line to give distributed directional deploy orders to collections units such as medium machineguns or AT guns isn’t working for me. I had to go into the unit_customformations2.lua supplied with s44 and modify the formationCmds array like this:

local formationCmds = {
	[CMD.MOVE] = true,
	[CMD.FIGHT] = true,
	[CMD.ATTACK] = true,
	[CMD.PATROL] = true,
	[CMD.UNLOAD_UNIT] = true,
	[CMD_UNIT_SET_TARGET] = true,
	[CMD_MORPH] = true,
	[CMD_TURN] = true,
	[30159] = true, -- Ger MG42 Med Machinegun
	[30173] = true, -- Ger Pak40 AT Gun
	[30179] = true, -- Ger leFH 18 Lt Howitzer
	[30133] = true, -- Ger Nebelwerfer 41 Rocket Artillery
	[30039] = true, -- US .30 cal Med Machinegun
	[30101] = true, -- US .30 cal Airborne Med Machinegun
	[30177] = true, -- US M5 AT Gun
	[30175] = true, -- US M2 Lt Howitzer
	[30049] = true, -- GBR Vickers Hvy Machinegun
	[30091] = true, -- GBR 17 pounder AT Gun
	[30111] = true, -- GBR 25 pounder Lt Howitzer
	[30123] = true, -- Rus Maxim Hvy Machinegun
	[30181] = true, -- Rus ZiS2 AT Gun
	[30047] = true, -- Rus ZiS3 Lt Field Gun
	[30063] = true  -- Rus M30 Med Howitzer
}

That got it working fine, but it looks a bit “hardcoded” which I know is a no-no when developing maintainable code. I believe there’s a function inside unit_customformations2.lua which accepts some parameters and returns these numbers but I couldn’t figure out how to properly call it.

I was testing svn rev 3976.