mirror of
https://github.com/kevinbentley/Descent3.git
synced 2025-01-22 11:28:56 +00:00
Resolve out-of-bounds access at start of level 10
Descent3/aipath.cpp:663:40: runtime error: index -1 out of bounds for type 'short unsigned int [5]'
This commit is contained in:
parent
10a03e71ef
commit
bb1d6f6f85
@ -651,6 +651,8 @@ static inline bool AIPathAddDPathNode(ai_path_info *aip, int *slot, int *cur_nod
|
||||
status = AIPathAddDPath(aip, handle);
|
||||
if (!status)
|
||||
Int3(); // chrishack -- out of dynamic paths
|
||||
if (aip->num_paths < 1)
|
||||
return false;
|
||||
|
||||
AIDynamicPath[*slot].num_nodes = MAX_NODES;
|
||||
*cur_node = 0;
|
||||
@ -660,7 +662,8 @@ static inline bool AIPathAddDPathNode(ai_path_info *aip, int *slot, int *cur_nod
|
||||
AIDynamicPath[*slot].pos[*cur_node] = *pos;
|
||||
AIDynamicPath[*slot].roomnum[(*cur_node)++] = room;
|
||||
|
||||
aip->path_end_node[aip->num_paths - 1] = *cur_node - 1;
|
||||
if (aip->num_paths >= 0)
|
||||
aip->path_end_node[aip->num_paths - 1] = *cur_node - 1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user