Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into kokekanon/all-featu…
Browse files Browse the repository at this point in the history
…re-redemption
  • Loading branch information
kokekanon committed Jan 15, 2025
2 parents 73896db + 88e27ed commit da9effe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
2 changes: 1 addition & 1 deletion data/scripts/actions/objects/cask_and_kegs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ local targetIdList = {
local flasks = Action()

function flasks.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if not target or not target:isItem() then
if not target or not target:getItem() then
return false
end

Expand Down
4 changes: 2 additions & 2 deletions src/database/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ void Database::createDatabaseBackup(bool compress) const {
std::ofstream configFile(tempConfigFile);
if (configFile.is_open()) {
configFile << "[client]\n";
configFile << "user=" << g_configManager().getString(MYSQL_USER) << "\n";
configFile << "password=" << g_configManager().getString(MYSQL_PASS) << "\n";
configFile << "user=\"" << g_configManager().getString(MYSQL_USER) << "\"\n";
configFile << "password=\"" << g_configManager().getString(MYSQL_PASS) << "\"\n";
configFile << "host=" << g_configManager().getString(MYSQL_HOST) << "\n";
configFile << "port=" << g_configManager().getNumber(SQL_PORT) << "\n";
configFile.close();
Expand Down
20 changes: 3 additions & 17 deletions src/items/tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1876,25 +1876,11 @@ std::shared_ptr<Item> Tile::getUseItem(int32_t index) const {
return ground;
}

if (index >= 0 && index < static_cast<int32_t>(items->size())) {
if (const auto &thing = getThing(index)) {
if (auto thingItem = thing->getItem()) {
return thingItem;
}
}
}

if (auto topDownItem = getTopDownItem()) {
return topDownItem;
if (const auto &thing = getThing(index)) {
return thing->getItem();
}

for (auto it = items->rbegin(), end = items->rend(); it != end; ++it) {
if ((*it)->getDoor()) {
return (*it)->getItem();
}
}

return !items->empty() ? *items->begin() : nullptr;
return nullptr;
}

std::shared_ptr<Item> Tile::getDoorItem() const {
Expand Down

0 comments on commit da9effe

Please sign in to comment.