MCP inspect_map_region: passableForLandUnits is true for water and impassable cells
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
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
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di CnCNet/WorldAlteringEditor
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
CnCNet/WorldAlteringEditor#276 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 43/100
CnCNet/WorldAlteringEditor#333 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
CnCNet/WorldAlteringEditor#326 ·
-
HouseType Parameter for Trigger Actions 3, 37, 38, & 74 do not Match Final Alert 2 for RA2 MissionsAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
CnCNet/WorldAlteringEditor#318 · 4 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
CnCNet/WorldAlteringEditor#317 ·
Tutte le issue di CnCNet/WorldAlteringEditor
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 89/100
getsentry/sentry-dotnet#5833 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area: core priority: low type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
RicoSuter/Namotion.Interceptor#863 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
bitfoundation/bitplatform#14428 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area-cli
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno