fix(CS-P4): Guard portal uses Land of Trials entry ExitGate (no spawn gate exists)
Some checks failed
.NET Core / build (push) Has been cancelled

Land of Trials (31) has no IsSpawnGate, so SafeZoneSpawnGate was null -> portal
said 'not available'. Fall back to the map's single entry ExitGate (60-69,10-19,
the real map entrance) so owner-guild members actually warp in.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Acentech Dev
2026-07-15 11:55:54 +03:00
parent d5097752af
commit f03f6aa7ad

View File

@@ -4,6 +4,7 @@
namespace MUnique.OpenMU.GameLogic.CastleSiege;
using System.Linq;
using System.Runtime.InteropServices;
using MUnique.OpenMU.GameLogic.NPC;
using MUnique.OpenMU.GameLogic.PlugIns;
@@ -45,7 +46,11 @@ public class CastleSiegeHuntingPortalTalkPlugIn : IPlayerTalkToNpcPlugIn
}
var map = await player.GameContext.GetMapAsync((ushort)CastleSiegeMapAccess.CastleHuntingMapNumber).ConfigureAwait(false);
if (map?.SafeZoneSpawnGate is not { } gate)
// Land of Trials has no spawn gate defined; fall back to its single entry ExitGate (the designated
// map entrance at ~60-69,10-19) so the player lands on walkable ground.
var gate = map?.SafeZoneSpawnGate ?? map?.Definition.ExitGates?.FirstOrDefault();
if (gate is null)
{
await ShowAsync(player, "The castle hunting ground is not available right now.").ConfigureAwait(false);
return;