Save system: ceremonial PR #42
| @@ -169,9 +169,6 @@ class SaveGameCathexis { | |||||||
|     this.#drawpile = new DrawPile(); |     this.#drawpile = new DrawPile(); | ||||||
|     this.#file = file; |     this.#file = file; | ||||||
|     this.#error = error; |     this.#error = error; | ||||||
|     if (this.#error != null && this.#file != null) { |  | ||||||
|       throw new Error("can't have a savefile _and_ an error"); |  | ||||||
|     } |  | ||||||
|     this.#done = false; |     this.#done = false; | ||||||
|   } |   } | ||||||
|  |  | ||||||
| @@ -186,8 +183,12 @@ class SaveGameCathexis { | |||||||
|     this.#drawpile.clear(); |     this.#drawpile.clear(); | ||||||
|     this.#drawpile.add(0, () => { |     this.#drawpile.add(0, () => { | ||||||
|       D.drawText( |       D.drawText( | ||||||
|         this.#error |         this.#error && this.#file | ||||||
|           ? `Your save file was invalid and could not be loaded: |           ? `A save was invalid. Continue from an alternate save? | ||||||
|  |  | ||||||
|  | ${this.#error}` | ||||||
|  |           : this.#error | ||||||
|  |             ? `Your save was invalid: | ||||||
|  |  | ||||||
| ${this.#error}` | ${this.#error}` | ||||||
|           : "Resume from save?", |           : "Resume from save?", | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user