Mes recomanacions de cppcheck aplicades

Abans de tocar unes cosetes de strings buits
This commit is contained in:
2024-10-13 13:49:00 +02:00
parent b2122ac239
commit 46b19ee82f
22 changed files with 995 additions and 1062 deletions

View File

@@ -6,15 +6,14 @@ class Texture;
// Constructor
Item::Item(int kind, float x, float y, SDL_Rect *play_area, std::shared_ptr<Texture> texture, std::vector<std::string> *animation)
: kind_(kind), play_area_(play_area)
: sprite_(std::make_unique<AnimatedSprite>(texture, "", animation)),
accel_x_(0.0f),
floor_collision_(false),
kind_(kind),
enabled_(true),
play_area_(play_area),
time_to_live_(600)
{
sprite_ = std::make_unique<AnimatedSprite>(texture, "", animation);
enabled_ = true;
time_to_live_ = 600;
accel_x_ = 0.0f;
floor_collision_ = false;
if (kind == ITEM_COFFEE_MACHINE)
{
width_ = 28;