From: LMH Date: Sun, 15 Sep 2013 09:07:09 +0000 (-1000) Subject: Check to make sure worldmap level sprite has a 'perfect' action before trying to... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=5d875d71ed6e7cff4e765eeb80e4394e16cefa3f;p=supertux.git Check to make sure worldmap level sprite has a 'perfect' action before trying to set it once level is completed --- diff --git a/src/worldmap/worldmap.cpp b/src/worldmap/worldmap.cpp index 09bb8b540..339e4e729 100644 --- a/src/worldmap/worldmap.cpp +++ b/src/worldmap/worldmap.cpp @@ -482,7 +482,8 @@ WorldMap::finished_level(Level* gamelevel) get_level_target_time(*level); if(level->statistics.completed(level->statistics, level->target_time)) { level->perfect = true; - level->sprite->set_action("perfect"); + if(level->sprite->has_action("perfect")) + level->sprite->set_action("perfect"); } save_state();