Skip to content

Commit 2cf1e37

Browse files
Fix default carrier action not being applied when setting waypoints
1 parent 2400ce4 commit 2cf1e37

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

client/src/game/map.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ export class Map {
252252
const panToUser = () => this.panToUser(this.game!);
253253
const panToPlayer = ({ player }: { player: Player }) => this.panToPlayer(this.game!, player);
254254
const clearHighlightedLocations = () => this.clearCarrierHighlights();
255-
const highlightLocation = ({ object, opacity }: { object: MapObject<string>, opacity: number }) => this.highlightLocation(object, opacity);
255+
const highlightLocation = ({ object, opacity }: { object: MapObject<string>, opacity: number }) => this.highlightLocation(object.location, opacity);
256256
const clickStar = ({ starId }: { starId: string }) => this.clickStar(starId);
257257
const clickCarrier = ({ carrierId }: { carrierId: string }) => this.clickCarrier(carrierId);
258258
const removeLastRulerWaypoint = () => this.removeLastRulerPoint();
@@ -1000,7 +1000,7 @@ export class Map {
10001000
if (this.background) this.background.refreshZoom(zoomPercent)
10011001
}
10021002

1003-
highlightLocation (location, opacity = 1) {
1003+
highlightLocation (location: Location, opacity = 1) {
10041004
let graphics = new PIXI.Graphics()
10051005
let radius = 12
10061006

client/src/views/game/components/carrier/CarrierWaypoints.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ import CarrierApiService from '../../../../services/api/carrier'
8585
import AudioService from '../../../../game/audio'
8686
import OrbitalMechanicsETAWarningVue from '../shared/OrbitalMechanicsETAWarning.vue'
8787
import {eventBusInjectionKey} from "../../../../eventBus";
88+
import MapEventBusEventNames from "@/eventBusEventNames/map";
8889
8990
export default {
9091
components: {
@@ -127,10 +128,10 @@ export default {
127128
GameContainer.setMode('waypoints', this.carrier)
128129
129130
this.waypointCreatedHandler = this.onWaypointCreated.bind(this);
130-
this.eventBus.on('onWaypointCreated', this.waypointCreatedHandler);
131+
this.eventBus.on(MapEventBusEventNames.MapOnWaypointCreated, this.waypointCreatedHandler);
131132
132133
this.waypointOutOfRangeHandler = this.onWaypointOutOfRange.bind(this);
133-
this.eventBus.on('onWaypointOutOfRange', this.waypointOutOfRangeHandler);
134+
this.eventBus.on(MapEventBusEventNames.MapOnWaypointOutOfRange, this.waypointOutOfRangeHandler);
134135
135136
this.oldWaypoints = this.carrier.waypoints.slice(0);
136137
this.oldWaypointsLooped = this.carrier.waypointsLooped;
@@ -200,17 +201,17 @@ export default {
200201
this.recalculateTotalEta()
201202
this.recalculateLooped()
202203
},
203-
onWaypointCreated (e) {
204+
onWaypointCreated ({ waypoint }) {
204205
// Overwrite the default action and default action ships
205-
e.action = this.$store.state.settings.carrier.defaultAction
206-
e.actionShips = this.$store.state.settings.carrier.defaultAmount
206+
waypoint.action = this.$store.state.settings.carrier.defaultAction
207+
waypoint.actionShips = this.$store.state.settings.carrier.defaultAmount
207208
208209
AudioService.type()
209210
210211
this.recalculateTotalEta()
211212
this.recalculateLooped()
212213
},
213-
onWaypointOutOfRange (e) {
214+
onWaypointOutOfRange ({ waypoint }) {
214215
this.$toast.error(`This waypoint is out of hyperspace range.`)
215216
},
216217
recalculateTotalEta () {

0 commit comments

Comments
 (0)