Fixed quest bug when hotrealoading

This commit is contained in:
erik 2025-06-22 17:13:38 +02:00
parent e9a113abdd
commit 553a2388d1
2 changed files with 37 additions and 0 deletions

View file

@ -517,6 +517,29 @@ namespace MosswartMassacre
// 7. Reinitialize cached Prismatic Taper count // 7. Reinitialize cached Prismatic Taper count
InitializePrismaticTaperCount(); InitializePrismaticTaperCount();
// 8. Reinitialize quest manager for hot reload
try
{
if (questManager == null)
{
questManager = new QuestManager();
WriteToChat("[OK] Quest manager reinitialized");
// Request quest data immediately
questManager.RefreshQuests();
WriteToChat("[INFO] Requesting quest data for hot reload...");
}
else
{
WriteToChat("[INFO] Quest manager already active, refreshing data...");
questManager.RefreshQuests();
}
}
catch (Exception ex)
{
WriteToChat($"[ERROR] Quest manager hot reload failed: {ex.Message}");
}
WriteToChat("Hot reload initialization completed!"); WriteToChat("Hot reload initialization completed!");
} }
@ -1289,6 +1312,7 @@ namespace MosswartMassacre
WriteToChat("/mm update - Download and install update (if available)"); WriteToChat("/mm update - Download and install update (if available)");
WriteToChat("/mm debugupdate - Debug update UI controls"); WriteToChat("/mm debugupdate - Debug update UI controls");
WriteToChat("/mm sendinventory - Force inventory upload with ID requests"); WriteToChat("/mm sendinventory - Force inventory upload with ID requests");
WriteToChat("/mm refreshquests - Force quest data refresh for Flag Tracker");
break; break;
case "report": case "report":
TimeSpan elapsed = DateTime.Now - statsStartTime; TimeSpan elapsed = DateTime.Now - statsStartTime;
@ -1707,6 +1731,19 @@ namespace MosswartMassacre
} }
break; break;
case "refreshquests":
// Force quest data refresh
if (questManager != null)
{
WriteToChat("[QUEST] Refreshing quest data...");
questManager.RefreshQuests();
}
else
{
WriteToChat("[QUEST] Quest manager not initialized");
}
break;
default: default:
WriteToChat($"Unknown /mm command: {subCommand}. Try /mm help"); WriteToChat($"Unknown /mm command: {subCommand}. Try /mm help");
break; break;