| 249 | const JOINER = '\n' + MATCHER; | 249 | const JOINER = '\n' + MATCHER; |
| 250 | let result = MATCHER + this.#depthBuffer.slice(this.#startDepth, depth).join(JOINER); | 250 | let result = MATCHER + this.#depthBuffer.slice(this.#startDepth, depth).join(JOINER); |
| 251 | | 251 | |
| 252 | if (entry.matchPersonaDescription) { | 252 | if (entry.matchPersonaDescription && this.#globalScanData.personaDescription) { |
| 253 | result += JOINER + this.#globalScanDataBuffer.personaDescription; | 253 | result += JOINER + this.#globalScanData.personaDescription; |
| 254 | } | 254 | } |
| 255 | if (entry.matchCharacterDescription) { | 255 | if (entry.matchCharacterDescription && this.#globalScanData.characterDescription) { |
| 256 | result += JOINER + this.#globalScanDataBuffer.characterDescription; | 256 | result += JOINER + this.#globalScanData.characterDescription; |
| 257 | } | 257 | } |
| 258 | if (entry.matchCharacterPersonality) { | 258 | if (entry.matchCharacterPersonality && this.#globalScanData.characterPersonality) { |
| 259 | result += JOINER + this.#globalScanDataBuffer.characterPersonality; | 259 | result += JOINER + this.#globalScanData.characterPersonality; |
| 260 | } | 260 | } |
| 261 | if (entry.matchCharacterDepthPrompt) { | 261 | if (entry.matchCharacterDepthPrompt && this.#globalScanData.characterDepthPrompt) { |
| 262 | result += JOINER + this.#globalScanDataBuffer.characterDepthPrompt; | 262 | result += JOINER + this.#globalScanData.characterDepthPrompt; |
| 263 | } | 263 | } |
| 264 | if (entry.matchScenario) { | 264 | if (entry.matchScenario && this.#globalScanData.scenario) { |
| 265 | result += JOINER + this.#globalScanDataBuffer.scenario; | 265 | result += JOINER + this.#globalScanData.scenario; |
| 266 | } | 266 | } |
| 267 | if (entry.matchCreatorNotes) { | 267 | if (entry.matchCreatorNotes && this.#globalScanData.creatorNotes) { |
| 268 | result += JOINER + this.#globalScanDataBuffer.creatorNotes; | 268 | result += JOINER + this.#globalScanData.creatorNotes; |
| 269 | } | 269 | } |
| 270 | | 270 | |
| 271 | if (this.#injectBuffer.length > 0) { | 271 | if (this.#injectBuffer.length > 0) { |