1
0
Fork 0

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:
ThorstenB 2010-11-27 20:05:28 +01:00
parent b037a80e5f
commit d438a180ab

View file

@ -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() : "");