Hi, i'm working on a new mod, a device to restore ammunition it work but i have a problem
i've this
var ballisticWeapons = ship.GetWeaponsOfType(args.ship_id, 2);
//check weapon
if (ballisticWeapons == null)
{
ship.DeviceDeactivate(args.ship_id, args.slot_id, true);
game.SendNotificationError(game.GetShipOwner(args.ship_id), "No Ballistic Weapon"); // Repair is not required: Repair is not required.
return;
}
not working, the game just ignore the if.
i've tried if (ballisticWeapons == undefined)
if (!ballisticWeapons )
and nothing work.
Is someone have an idea why it's not working?