Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: shadowing "date", move to the correct place #3219

Merged
merged 2 commits into from
Jan 5, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/io/io_bosstiary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
return;
}

auto date = result->getNumber<uint16_t>("date");
auto timeNow = getTimeNow();
auto time = localtime(&timeNow);
auto today = time->tm_mday;

const auto &bossMap = getBosstiaryMap();
if (bossMap.size() <= 1) {
g_logger().error("[{}] It is not possible to create a boosted boss with only one registered boss. (CODE 02)", __FUNCTION__);
Expand All @@ -42,6 +37,9 @@
if (!result) {
g_logger().warn("[{}] No boosted boss found in g_database(). A new one will be selected.", __FUNCTION__);
} else {
auto timeNow = getTimeNow();
auto time = localtime(&timeNow);
auto today = time->tm_mday;
auto date = result->getNumber<uint16_t>("date");
if (date == today) {
std::string bossName = result->getString("boostname");
Expand Down Expand Up @@ -75,7 +73,7 @@

query = fmt::format(
"UPDATE `boosted_boss` SET `date` = '{}', `boostname` = {}, `raceid` = '{}', ",
today, database.escapeString(bossName), bossId

Check failure on line 76 in src/io/io_bosstiary.cpp

View workflow job for this annotation

GitHub Actions / windows-2022-windows-release

'today': undeclared identifier

Check failure on line 76 in src/io/io_bosstiary.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-linux-release

‘today’ was not declared in this scope

Check failure on line 76 in src/io/io_bosstiary.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-linux-debug

‘today’ was not declared in this scope

Check failure on line 76 in src/io/io_bosstiary.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-24.04-linux-release

‘today’ was not declared in this scope

Check failure on line 76 in src/io/io_bosstiary.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-24.04-linux-debug

‘today’ was not declared in this scope
);

if (const auto bossType = getMonsterTypeByBossRaceId(bossId); bossType) {
Expand Down
Loading