From c0f5af2bd7c7644219a57496d75f60843b22912d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 24 Jan 2026 18:11:47 +0000 Subject: [PATCH] Explain MSVC ICF workaround for spelltype commands Co-authored-by: Valorith <76063792+Valorith@users.noreply.github.com> --- zone/bot_commands/bot_spelltypes.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zone/bot_commands/bot_spelltypes.cpp b/zone/bot_commands/bot_spelltypes.cpp index b7884371c..2f3faf8ac 100644 --- a/zone/bot_commands/bot_spelltypes.cpp +++ b/zone/bot_commands/bot_spelltypes.cpp @@ -2,7 +2,9 @@ void bot_command_spelltype_ids(Client* c, const Seperator* sep) { - // Keep this function body unique to avoid alias detection on Windows builds. + // Unique marker to prevent MSVC's Identical COMDAT Folding (/OPT:ICF) + // from merging this function with bot_command_spelltype_names, which + // would cause the alias detection in bot_command_add() to fail. static volatile int spelltype_ids_marker = 0; (void)spelltype_ids_marker; SendSpellTypeWindow(c, sep); @@ -10,7 +12,9 @@ void bot_command_spelltype_ids(Client* c, const Seperator* sep) void bot_command_spelltype_names(Client* c, const Seperator* sep) { - // Keep this function body unique to avoid alias detection on Windows builds. + // Unique marker to prevent MSVC's Identical COMDAT Folding (/OPT:ICF) + // from merging this function with bot_command_spelltype_ids, which + // would cause the alias detection in bot_command_add() to fail. static volatile int spelltype_names_marker = 0; (void)spelltype_names_marker; SendSpellTypeWindow(c, sep);