Repository navigation
Keep nav area attributes when marking stairs - #2225
Merged
sunzenshen merged 1 commit intoOct 17, 2026
Merged
Conversation
CNavArea::TestStairs() replaced every attribute of a stair area with NAV_MESH_STAIRS. MarkStairAreas() runs on every nav load (nav_file.cpp), so a stair area lost its hand-set attributes each time a map loaded, in every match and in every nav_analyze save. Two NeotokyoRebuild/neoAssets meshes mark stair areas this way: ntre_rise_ctg areas 2720 and 2777 (AVOID) and ntre_vtol_ctg areas 149 and 39678 (PRECISE and CLIFF). Their marks were gone by the time a bot planned a path. Set the stairs flag with an OR instead. The line that clears the flag at the top of the function is unchanged, so an area that stops testing as stairs still loses only that flag.
This was referenced Oct 13, 2026
sunzenshen
marked this pull request as ready for review
October 13, 2026 01:23
sunmachine
approved these changes
Oct 17, 2026
sunmachine
left a comment
Contributor
There was a problem hiding this comment.
I thought I was crazy when I was toying with this like a month ago.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a side effect of marking an area as NAV_MESH_STAIRS which clears out any other properties of the nav area.
CNavArea::TestStairs()replaces every attribute of a stair area withNAV_MESH_STAIRS.MarkStairAreas()calls it for every area on every nav load (nav_file.cpp), so an attribute set by hand on a stair area is erased each time a map loads, and again in everynav_analyzesave.This PR sets the flag with an OR instead (
SetAttributes( GetAttributes() | NAV_MESH_STAIRS )). One file,nav_generate.cpp, +6. The flag-clearing line at the top of the function is unchanged, so an area that stops testing as stairs loses only that flag.Who it affects
No mesh on master has a hand-set attribute on a stair area, so master's behavior does not change. Two navmesh PRs in neoAssets have such areas:
AVOIDandSTAIRS; a stock load dropsAVOIDPRECISE,CLIFFandSTAIRS; a stock load dropsPRECISEandCLIFFIt was found because the attributes were present in the
.navfiles but missing from bots' in-game area data, and anav_analyzesave of those meshes had lost them too.Tested
Release dedicated server build of this branch, no compiler warnings. Loaded the ntre_rise_ctg mesh from neoAssets#160 and ran
nav_edit 1; nav_save, then read the saved file's area attributes:On this branch the saved file is byte-identical to the committed one. The vtol areas were not checked in game.
STAIRSis still set on exactly the areas that test as stairs, so a mesh without hand-set stair attributes loads as before.