The units are in basedata and set to have microwaves. I tell it to create the units and change the mics to lasers if they're eden.
for (i = 0; i < baseInfo.numVehicle; i++)
{
VehicleInfoE &curItem = baseInfo.vehicleInfo[i];
curX = x + curItem.x;
curY = y + curItem.y;
TethysGame::CreateUnit(unit, curItem.type, LOCATION(curX, curY),
player, curItem.weaponCargo, curItem.dir);
unit.DoSetLights(1);
if (unit.GetType() == mapCargoTruck)
unit.SetTruckCargo( curItem.ctcargo, curItem.cnum);
for (int i = 0; i < TethysGame::NoPlayers(); i++)
{
if (Player[i].IsEden() && unit.GetType() == mapLynx)
unit.SetWeapon( mapLaser);
}
}
Hmm, well what would happen here is the unit would always be a laser (if ANY of the players were Eden), because it loops thru all players.
A better way of doing it might be like this:
for (i = 0; i < baseInfo.numVehicle; i++)
{
VehicleInfoE &curItem = baseInfo.vehicleInfo[i];
curX = x + curItem.x;
curY = y + curItem.y;
if (Player[player].IsEden() && curItem.type == mapLynx)
curItem.weaponCargo = mapLaser;
TethysGame::CreateUnit(unit, curItem.type, LOCATION(curX, curY),
player, curItem.weaponCargo, curItem.dir);
// ... and so on ...
}