v2.1.1: Fix swipe detection in together mode and combat encounter prompt

This commit is contained in:
Spicy_Marinara
2026-01-02 20:58:49 +01:00
parent 87f0931942
commit d44bb1cff9
5 changed files with 11 additions and 6 deletions
+1 -1
View File
@@ -500,7 +500,7 @@ export async function buildCombatActionPrompt(action, combatStats) {
});
stateMessage += `\n${userName}'s Action: ${action}\n\n`;
stateMessage += `Respond with a JSON object containing ONLY updated HP values and new status effects. DO NOT regenerate character descriptions, sprites, or environment:\n`;
stateMessage += `Respond with the exact JSON object as below, containing ONLY these specified values. Remember to consider the user's party and their moves. DO NOT regenerate character descriptions, sprites, or environment:\n`;
stateMessage += `{\n`;
stateMessage += ` "combatStats": {\n`;
stateMessage += ` "party": [{ "name": "Name", "hp": X, "maxHp": X, "statuses": [...] }],\n`;
+2 -1
View File
@@ -156,7 +156,8 @@ export async function onMessageReceived(data) {
// console.log('[RPG Companion] Stored RPG data for swipe', currentSwipeId);
// If there's no committed data yet (first time generating), automatically commit
if (!committedTrackerData.userStats && !committedTrackerData.infoBox && !committedTrackerData.characterThoughts) {
// BUT: Only commit if this is NOT a swipe (same logic as separate mode)
if (!lastActionWasSwipe && !committedTrackerData.userStats && !committedTrackerData.infoBox && !committedTrackerData.characterThoughts) {
committedTrackerData.userStats = parsedData.userStats;
committedTrackerData.infoBox = parsedData.infoBox;
committedTrackerData.characterThoughts = parsedData.characterThoughts;