diff --git a/source/abstract/Character.cpp b/source/abstract/Character.cpp index 880312b..a74340c 100644 --- a/source/abstract/Character.cpp +++ b/source/abstract/Character.cpp @@ -20,6 +20,8 @@ const int Character::DEFAULT_HEALTH = 100; const std::string Character::KEY_SPEED = "speed"; const float Character::DEFAULT_SPEED = 100; const float Character::POINT_REACHED_DISTANCE = 1.0f; +const std::string Character::KEY_WEAPON = "weapon"; +const std::string Character::DEFAULT_WEAPON = "weapon.yaml"; std::vector Character::mCharacterInstances = std::vector(); /** @@ -33,7 +35,7 @@ Character::Character(World& world, Pathfinder& pathfinder, mMaxHealth(config.get(KEY_HEALTH, DEFAULT_HEALTH)), mCurrentHealth(mMaxHealth), mMovementSpeed(config.get(KEY_SPEED, DEFAULT_SPEED)), - mWeapon(world, *this, Yaml("weapon.yaml")), + mWeapon(world, *this, Yaml(config.get(KEY_WEAPON, DEFAULT_WEAPON))), mStartPathfinding(false) { mCharacterInstances.push_back(this); } diff --git a/source/abstract/Character.h b/source/abstract/Character.h index 0bddb52..0cb2671 100644 --- a/source/abstract/Character.h +++ b/source/abstract/Character.h @@ -53,6 +53,8 @@ private: static const int DEFAULT_HEALTH; static const std::string KEY_SPEED; static const float DEFAULT_SPEED; + static const std::string KEY_WEAPON; + static const std::string DEFAULT_WEAPON; /// The distance to a point where it is considered reached. static const float POINT_REACHED_DISTANCE;