Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

MCP inspect_map_region: passableForLandUnits is true for water and impassable cells

Aperta Adatta ai principianti
#343 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
backend

Direzione di ricerca

Inizia in src/MapEditorMCP/Infos/CellInfo.cs, nel calcolo di passableForLandUnits, e confrontalo con i chiamanti dell’overload int di Helpers.IsLandTypeImpassable. Aggiorna la percorribilità riportata affinché utilizzi il tipo di terreno TMP grezzo, quindi esegui i test pertinenti oppure compila e verifica che l’acqua e le celle impercorribili non siano segnalate come percorribili dalle unità terrestri.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Version: 1.9.6 (d4e297f, also current master)

What happens

inspect_map_region (and other MCP tools that return CellInfo) report
passableForLandUnits: true for cells that are water or impassable.
Observed on a TEMPERATE river map: cells with landType: "Tunnel" (raw TMP
terrain type 9, river water) come back with passableForLandUnits: true and
passableForNavalUnits: true; cells with landType: "15" (impassable) also
come back land-passable.

Why

src/MapEditorMCP/Infos/CellInfo.cs (lines 72-76) casts the TMP terrain type
to the LandType enum and calls Helpers.IsLandTypeImpassable(LandType, true).
That overload only knows LandType.Rock (7) and LandType.Water (10):

public static bool IsLandTypeImpassable(LandType landType, bool considerLandUnitsOnly)
    => landType == LandType.Rock || (considerLandUnitsOnly && landType == LandType.Water);

Every other caller (MapIssueChecker, the overlay mutations,
TerrainGenerationMutation, MapView) uses the int overload, which treats
0x1-0x4, 0x9 and 0xA as water and 0x7, 0x8 and 0xF as impassable.
passableForNavalUnits is correct, because
IsLandTypeImpassableForNavalUnits(LandType) forwards to the int overload.

Suggested fix

!Helpers.IsLandTypeImpassable(subTileInfo.TmpImage.TerrainType, true)

Related, smaller: landType is ((LandType)TerrainType).ToString(), so
raw values 11-15 are printed as numbers and raw 9 (water in YR TMPs) is
printed as "Tunnel". MCP clients that read the name get the wrong idea;
exposing the raw value as well (e.g. landTypeId) would help.

Found while building an MCP client for the editor; we now classify by the raw
code on our side.

Lingua principale
C#
Stelle
148
Fork
49
Merge medio
4g 9h
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di CnCNet/WorldAlteringEditor

Tutte le issue di CnCNet/WorldAlteringEditor

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.