diff --git a/include/Component.h b/include/Component.h index 5003dc3..8f4a70a 100644 --- a/include/Component.h +++ b/include/Component.h @@ -1,6 +1,7 @@ #pragma once -#include +#include + class Entity; class Component diff --git a/src/SoundManager.cpp b/src/SoundManager.cpp index 182d616..6775725 100644 --- a/src/SoundManager.cpp +++ b/src/SoundManager.cpp @@ -66,12 +66,12 @@ void SoundManager::playSound(GameInternal* game, std::string sound, bool canOver if(Mix_VolumeChunk(game->assets->getSound(sound), volume) == -1) { - std::cerr << "Error adjusting volume: " /*<< Mix_GetError()*/ << std::endl; + std::cerr << "Error adjusting volume: " << SDL_GetError() << std::endl; } if (Mix_PlayChannel(channel, game->assets->getSound(sound), loops) == -1) { - std::cerr << "Error playing sound '" << sound << "': " /*<< Mix_GetError()*/ << std::endl; + std::cerr << "Error playing sound '" << sound << "': " << SDL_GetError() << std::endl; } } @@ -88,12 +88,12 @@ void SoundManager::playMusic(GameInternal* game, std::string music, int loops, i if(Mix_VolumeMusic(volume) == -1) { - std::cerr << "Error adjusting volume: " /*<< Mix_GetError()*/ << std::endl; + std::cerr << "Error adjusting volume: " << SDL_GetError() << std::endl; } if (Mix_PlayMusic(game->assets->getMusic(music), loops) == -1) { - std::cerr << "Error playing music '" << music << "': " /*<< Mix_GetError()*/ << std::endl; + std::cerr << "Error playing music '" << music << "': " << SDL_GetError() << std::endl; } } diff --git a/src/StatEffectsComponent.cpp b/src/StatEffectsComponent.cpp index 05ab31a..8d4d7ee 100644 --- a/src/StatEffectsComponent.cpp +++ b/src/StatEffectsComponent.cpp @@ -12,12 +12,10 @@ void StatEffectsComponent::update(uint_fast16_t diffTime) { for (int i = 0; i < MAX_STATS; i++) { - if (this->buffs.at(i) <= 0) continue; - if (this->buffs.at(i) - diffTime <= 0) - { + this->buffs.at(i) -= diffTime; + if (this->buffs.at(i) <= 0) { this->resetStatValue((Stats)i); } - this->buffs.at(i) -= diffTime; } } @@ -32,7 +30,7 @@ void StatEffectsComponent::modifyStatValue(Stats stat, int modifier) //modifier switch (stat) { case Stats::MOVEMENT_SPEED: - this->entity->getComponent().modifySpeed(modifier * 60); + this->entity->getComponent().modifySpeed(modifier); break; case Stats::ATTACK_SPEED: // this->entity->getComponent().modifyAtkSpeed(modifier);