From 04dd457efa886333c05135e525415d8ff783a939 Mon Sep 17 00:00:00 2001 From: dingo Date: Mon, 23 Mar 2026 13:01:08 -0400 Subject: [PATCH] Fix SetAffinity tile layout: Base1=Void, Base2=affinity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Setting both slots to the same basic affinity produces the wrong resolved value (Lake+Lake→Ocean). Basic tiles are represented as (Void, Basic) per §8, so SetAffinity now sets Base1=Void and Base2=newAffinity. Both original slot values are still tracked for reversal when the duration expires. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- Server/src/SOR.Game/Abilities/AbilitySystem.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Server/src/SOR.Game/Abilities/AbilitySystem.cs b/Server/src/SOR.Game/Abilities/AbilitySystem.cs index f94b187..5e0437b 100644 --- a/Server/src/SOR.Game/Abilities/AbilitySystem.cs +++ b/Server/src/SOR.Game/Abilities/AbilitySystem.cs @@ -1007,14 +1007,15 @@ public static class AbilitySystem } case SetAffinityEffect sa when target is Coord coord: { - // SetAffinity on a tile writes both slots so the resolved affinity is unambiguous, - // and tracks a reversal for each slot so both are restored when the duration expires. + // SetAffinity on a tile uses the basic-tile layout: Base1=Void, Base2=affinity. + // Setting both slots to the same basic value would combine incorrectly + // (e.g. Lake+Lake → Ocean), so we follow the §8 convention instead. var tile = ctx.State.Board?.GetTile(coord); if (tile is null) break; var origBase1 = tile.Base1; var origBase2 = tile.Base2; var newAff = ResolveAffinity(sa.Affinity, ctx); - tile.Base1 = newAff; + tile.Base1 = Affinity.Void; tile.Base2 = newAff; var tileRef = $"tile:{coord.X},{coord.Y}"; TrackEffect(new SetBaseAffinity1Effect { Affinity = new AffinityExpr { Fixed = origBase1 } },