Fixed unit test (accessing world which does not exist during

unit tests, when delaying cakes at start of race).
This commit is contained in:
hiker 2019-01-09 12:55:06 +11:00
parent 20882b9e29
commit 7fec380398

View File

@ -604,8 +604,9 @@ PowerupManager::PowerupType PowerupManager::getRandomPowerup(unsigned int pos,
*n=1;
// Prevents early explosive items
if (stk_config->ticks2Time(World::getWorld()->getTicksSinceStart()) <
stk_config->m_no_explosive_items_timeout)
if (World::getWorld() &&
stk_config->ticks2Time(World::getWorld()->getTicksSinceStart()) <
stk_config->m_no_explosive_items_timeout)
{
if (powerup == POWERUP_CAKE || powerup == POWERUP_RUBBERBALL)
powerup = POWERUP_BOWLING;