Skip to content

Commit

Permalink
fix: factionless worldevent#tostring (#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sainan authored Apr 4, 2024
1 parent bdb137b commit fa8443a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/models/WorldEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,12 @@ export default class WorldEvent extends WorldstateObject {
* @returns {string} the event's string representation
*/
toString() {
let lines = [`${this.description} : ${this.faction}`];
let lines = [];
if (this.faction) {
lines.push(`${this.description} : ${this.faction}`);
} else {
lines.push(this.description);
}

if (this.scoreLocTag && this.maximumScore) {
lines.push(`${this.scoreLocTag} : ${this.maximumScore}`);
Expand Down

0 comments on commit fa8443a

Please sign in to comment.