Fix route manager exception and following crash (may fix #177)
See bug issue #177 for more. Also fix minor compiler warning.
This commit is contained in:
parent
b037a80e5f
commit
d438a180ab
1 changed files with 2 additions and 2 deletions
|
@ -673,7 +673,7 @@ void FGRouteMgr::insertWayptAtIndex(Waypt* aWpt, int aIndex)
|
|||
}
|
||||
|
||||
int index = aIndex;
|
||||
if ((aIndex == -1) || (aIndex > _route.size())) {
|
||||
if ((aIndex == -1) || (aIndex > (int) _route.size())) {
|
||||
index = _route.size();
|
||||
}
|
||||
|
||||
|
@ -1027,7 +1027,7 @@ void FGRouteMgr::jumpToIndex(int index)
|
|||
|
||||
void FGRouteMgr::currentWaypointChanged()
|
||||
{
|
||||
Waypt* cur = currentWaypt();
|
||||
Waypt* cur = (_currentIndex<numWaypts()) ? currentWaypt() : NULL;
|
||||
Waypt* next = nextWaypt();
|
||||
|
||||
wp0->getChild("id")->setStringValue(cur ? cur->ident() : "");
|
||||
|
|
Loading…
Add table
Reference in a new issue