From b4f6b919d7869a2a8c372c0a0c2762ab217de18f Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Fri, 7 Nov 2025 23:26:00 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20coreci=C3=B3=20de=20rutes=20en=20resourc?= =?UTF-8?q?e=5Fhelper.cpp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/core/resources/resource_helper.cpp | 7 +++++++ source/game/entities/player.cpp | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/source/core/resources/resource_helper.cpp b/source/core/resources/resource_helper.cpp index 7a0776f3..771bd1b4 100644 --- a/source/core/resources/resource_helper.cpp +++ b/source/core/resources/resource_helper.cpp @@ -107,6 +107,13 @@ auto getPackPath(const std::string& asset_path) -> std::string { // Convert backslashes to forward slashes std::ranges::replace(path, '\\', '/'); + // If it's an absolute path containing "/data/", extract everything after "/data/" + // This handles paths like: /Users/sergio/.../data/palette/file.pal -> palette/file.pal + size_t data_pos = path.find("/data/"); + if (data_pos != std::string::npos) { + return path.substr(data_pos + 6); // +6 to skip "/data/" + } + // Remove leading slashes while (!path.empty() && path[0] == '/') { path = path.substr(1); diff --git a/source/game/entities/player.cpp b/source/game/entities/player.cpp index afd09082..177d2c14 100644 --- a/source/game/entities/player.cpp +++ b/source/game/entities/player.cpp @@ -448,7 +448,6 @@ void Player::playJumpSound(float delta_time) { if (jump_sound_ctrl_.shouldPlay(delta_time, sound_index)) { if (sound_index < jumping_sound_.size()) { Audio::get()->playSound(jumping_sound_[sound_index], Audio::Group::GAME); - std::cout << sound_index << "\n"; } } } @@ -460,7 +459,6 @@ void Player::playFallSound(float delta_time) { if (fall_sound_ctrl_.shouldPlay(delta_time, y_, sound_index)) { if (sound_index < falling_sound_.size()) { Audio::get()->playSound(falling_sound_[sound_index], Audio::Group::GAME); - std::cout << sound_index << "\n"; } } }