1
0
Fork 0

Fixed ship listing "nothing" actions as available

This commit is contained in:
Michaël Lemaire 2017-03-09 19:43:24 +01:00
parent d3e12fa8e1
commit 0b327fec26
2 changed files with 6 additions and 1 deletions

View file

@ -51,6 +51,11 @@ module TS.SpaceTac.Specs {
equipment.action = new MoveAction(equipment);
slot.attach(equipment);
slot = ship.addSlot(SlotType.Weapon);
equipment = new Equipment();
equipment.slot = slot.type;
slot.attach(equipment);
actions = ship.getAvailableActions();
expect(actions.length).toBe(2);
expect(actions[0].code).toEqual("move");

View file

@ -162,7 +162,7 @@ module TS.SpaceTac {
if (this.alive) {
this.slots.forEach((slot: Slot) => {
if (slot.attached && slot.attached.action) {
if (slot.attached && slot.attached.action && slot.attached.action.code != "nothing") {
actions.push(slot.attached.action);
}
});