MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / update_path

Method update_path

ogsr_engine/xrGame/movement_manager.cpp:134–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132const xr_vector<DetailPathManager::STravelPathPoint>& CMovementManager::path() const { return (detail().path()); }
133
134void CMovementManager::update_path()
135{
136 START_PROFILE("Build Path::update")
137
138 if (!enabled() || wait_for_distributed_computation())
139 return;
140
141 if (!game_path().evaluator())
142 game_path().set_evaluator(base_game_params());
143
144 if (!level_path().evaluator())
145 level_path().set_evaluator(base_level_params());
146
147#pragma todo("Optimize this in case of slowdown or not intended behaviour")
148 if (!restrictions().actual())
149 {
150 m_path_actuality = false;
151 }
152
153 restrictions().actual(true);
154
155 if (!actual())
156 {
157 game_path().make_inactual();
158 level_path().make_inactual();
159 patrol().make_inactual();
160 switch (m_path_type)
161 {
162 case ePathTypeGamePath: {
163 m_path_state = ePathStateSelectGameVertex;
164 break;
165 }
166 case ePathTypeLevelPath: {
167 m_path_state = ePathStateBuildLevelPath;
168 if (!restrictions().accessible(level_path().dest_vertex_id()))
169 {
170 Fvector temp;
171 level_path().set_dest_vertex(restrictions().accessible_nearest(ai().level_graph().vertex_position(level_path().dest_vertex_id()), temp));
172 detail().set_dest_position(temp);
173 }
174 else
175 {
176 if (!restrictions().accessible(detail().dest_position()))
177 {
178 detail().set_dest_position(ai().level_graph().vertex_position(level_path().dest_vertex_id()));
179 }
180 }
181 break;
182 }
183 case ePathTypePatrolPath: {
184 m_path_state = ePathStateSelectPatrolPoint;
185 break;
186 }
187 case ePathTypeNoPath: {
188 m_path_state = ePathStateDummy;
189 break;
190 }
191 default: NODEFAULT;

Callers 15

loadMethod · 0.45
load_gameMethod · 0.45
OpenDumperFunction · 0.45
SaveAttachableParamsMethod · 0.45
saveMethod · 0.45
loadMethod · 0.45
ExecuteMethod · 0.45
saved_game_full_nameMethod · 0.45
CSavedGameWrapperMethod · 0.45
ExecuteMethod · 0.45

Calls 13

enabledFunction · 0.85
dest_vertex_idMethod · 0.80
vertex_positionMethod · 0.80
set_dest_positionMethod · 0.80
PositionMethod · 0.80
objectFunction · 0.50
evaluatorMethod · 0.45
set_evaluatorMethod · 0.45
actualMethod · 0.45
make_inactualMethod · 0.45
accessibleMethod · 0.45
set_dest_vertexMethod · 0.45

Tested by

no test coverage detected