Retocado el mapa
This commit is contained in:
@@ -28,7 +28,7 @@ AnimatedSprite::~AnimatedSprite()
|
||||
// Obtiene el indice de la animación a partir del nombre
|
||||
int AnimatedSprite::getIndex(std::string name)
|
||||
{
|
||||
int index = 0;
|
||||
int index = -1;
|
||||
for (int i = 0; i < animation.size(); i++)
|
||||
{
|
||||
if (animation[i].name == name)
|
||||
@@ -36,6 +36,12 @@ int AnimatedSprite::getIndex(std::string name)
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (index == -1)
|
||||
{
|
||||
printf("** Warning: could not find \"%s\" animation\n", name.c_str());
|
||||
index = 0;
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user