Skip to content

Commit a89d952

Browse files
Replace && expressions with explicit if statements
1 parent 5e18d3b commit a89d952

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/client/graphics/layers/EventsDisplay.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ export class EventsDisplay extends LitElement implements Layer {
10351035
? this.renderButton({
10361036
content: this.getEventDescription(event),
10371037
onClick: () => {
1038-
event.focusID &&
1038+
if (event.focusID)
10391039
this.emitGoToPlayerEvent(event.focusID);
10401040
},
10411041
className: "text-left",
@@ -1044,7 +1044,7 @@ export class EventsDisplay extends LitElement implements Layer {
10441044
? this.renderButton({
10451045
content: this.getEventDescription(event),
10461046
onClick: () => {
1047-
event.unitView &&
1047+
if (event.unitView)
10481048
this.emitGoToUnitEvent(
10491049
event.unitView,
10501050
);

src/core/execution/RailroadExecution.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export class RailroadExecution implements Execution {
164164
}
165165

166166
private redrawBuildings() {
167-
this.railRoad.from.unit.isActive() && this.railRoad.from.unit.touch();
168-
this.railRoad.to.unit.isActive() && this.railRoad.to.unit.touch();
167+
if (this.railRoad.from.unit.isActive()) this.railRoad.from.unit.touch();
168+
if (this.railRoad.to.unit.isActive()) this.railRoad.to.unit.touch();
169169
}
170170
}

0 commit comments

Comments
 (0)