Fixed crash when using flying keys (I/K) outside of a game

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6493 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2010-11-10 16:54:08 +00:00
parent 60ac3f8491
commit 1f147f3544

View File

@ -97,13 +97,21 @@ void InputManager::handleStaticAction(int key, int value)
break;
case KEY_KEY_I:
{
if (world == NULL) break;
Kart* kart = world->getLocalPlayerKart(0);
if (kart == NULL) break;
kart->flyUp();
break;
}
case KEY_KEY_K:
{
if (world == NULL) break;
Kart* kart = world->getLocalPlayerKart(0);
if (kart == NULL) break;
kart->flyDown();
break;
}