Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release-v0.5' into no-pullreques…
Browse files Browse the repository at this point in the history
…t-dedicated-server-v0.5
  • Loading branch information
o01eg committed Oct 19, 2024
2 parents 77b3ae8 + dc3d6a4 commit bcfceb9
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 21 deletions.
7 changes: 3 additions & 4 deletions .github/debian-sid/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,15 @@ APT::Install-Recommends \"false\";\n\
APT::Install-Suggests \"false\";\n\
" > /etc/apt/apt.conf.d/docker-no-suggests

# add experimental repository to test issue https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1037667
# add experimental repository to test issue https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1074967
RUN echo "deb http://deb.debian.org/debian experimental main\n\
" >> /etc/apt/sources.list

RUN apt-get update --assume-yes
# install experimental g++ to test issue https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1037667
#RUN apt-get -t=experimental install --assume-yes g++ binutils # broken binutils dependency
# install experimental g++ to test issue https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1074967
RUN apt-get -t=experimental install --assume-yes g++ binutils # broken binutils dependency
RUN apt-get install --assume-yes \
git \
g++ \
make \
cmake \
python3 \
Expand Down
1 change: 1 addition & 0 deletions Empire/Diplomacy.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef _Diplomacy_h_
#define _Diplomacy_h_

#include <cstdint>
#include <string>
#include <boost/serialization/access.hpp>
#include "../util/Enum.h"
Expand Down
10 changes: 5 additions & 5 deletions GG/src/dialogs/FileDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <boost/cast.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem.hpp>
#include <boost/format.hpp>
// boost::spirit::classic pulls in windows.h which in turn defines macro
// versions of min and max. Defining NOMINMAX disables the creation of those
Expand Down Expand Up @@ -215,7 +215,7 @@ void FileDlg::CompleteConstruction()

if (!m_init_filename.empty()) {
fs::path filename_path = fs::system_complete(fs::path(m_init_filename));
m_files_edit->SetText(filename_path.leaf().string());
m_files_edit->SetText(filename_path.filename().string());
}
}

Expand Down Expand Up @@ -548,7 +548,7 @@ void FileDlg::UpdateList()
if (!m_in_win32_drive_selection) {
// parent directory selector
if ((s_working_dir.string() != s_working_dir.root_path().string() &&
!s_working_dir.branch_path().string().empty()) ||
!s_working_dir.parent_path().string().empty()) ||
Win32Paths())
{
auto row = Wnd::Create<ListBox::Row>();
Expand Down Expand Up @@ -694,10 +694,10 @@ void FileDlg::OpenDirectory()
} else if (directory == "..") {
// move to parent directory of current directory
if (s_working_dir.string() != s_working_dir.root_path().string() &&
!s_working_dir.branch_path().string().empty())
!s_working_dir.parent_path().string().empty())
{
// move to new directory
SetWorkingDirectory(s_working_dir.branch_path());
SetWorkingDirectory(s_working_dir.parent_path());

} else {
// switch to drive selection mode
Expand Down
5 changes: 3 additions & 2 deletions universe/Conditions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <array>
#include <cfloat>
#include <limits>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/st_connected.hpp>
Expand Down Expand Up @@ -7360,8 +7361,8 @@ bool EmpireStockpileValue::Match(const ScriptingContext& local_context) const {
return false;

try {
float low = (m_low ? m_low->Eval(local_context) : -Meter::LARGE_VALUE);
float high = (m_high ? m_high->Eval(local_context) : Meter::LARGE_VALUE);
float low = (m_low ? m_low->Eval(local_context) : std::numeric_limits<float>::lowest());
float high = (m_high ? m_high->Eval(local_context) : std::numeric_limits<float>::max());
float amount = empire->ResourceStockpile(m_stockpile);
return (low <= amount && amount <= high);
} catch (...) {
Expand Down
1 change: 1 addition & 0 deletions universe/Enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define _Enums_h_


#include <cstdint>
#include <iostream>
#include <map>
#include <string>
Expand Down
7 changes: 3 additions & 4 deletions util/Directories.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
#include "i18n.h"

#include <boost/algorithm/string/trim.hpp>
#include <boost/filesystem/convenience.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/filesystem.hpp>

#include <cstdlib>
#include <mutex>
Expand Down Expand Up @@ -266,7 +265,7 @@ void InitBinDir(std::string const& argv0)
#if defined(FREEORION_WIN32)
try {
fs::path binary_file = fs::system_complete(FilenameToPath(argv0));
bin_dir = binary_file.branch_path();
bin_dir = binary_file.parent_path();
} catch (const fs::filesystem_error &) {
bin_dir = fs::initial_path();
}
Expand Down Expand Up @@ -315,7 +314,7 @@ void InitBinDir(std::string const& argv0)
std::string path_text(buf);

fs::path binary_file = fs::system_complete(fs::path(path_text));
bin_dir = binary_file.branch_path();
bin_dir = binary_file.parent_path();

// check that a "freeoriond" file (hopefully the freeorion server binary) exists in the found directory
fs::path p(bin_dir);
Expand Down
3 changes: 1 addition & 2 deletions util/OptionsDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/erase.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem.hpp>
#include <boost/range/algorithm_ext/erase.hpp>
#include <boost/tokenizer.hpp>

Expand Down
9 changes: 5 additions & 4 deletions util/Order.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1625,11 +1625,12 @@ bool ShipDesignOrder::CheckRename(int empire_id, int existing_design_id, const s
}

const auto& universe = context.ContextUniverse();
// check if a design with this ID already exists
if (const auto existing = universe.GetShipDesign(existing_design_id)) {
// check if a design with this ID exists
auto existing = universe.GetShipDesign(existing_design_id);
if (!existing) {
ErrorLogger() << "Empire " << empire_id
<< " tried to create a new ShipDesign with an id, " << existing_design_id
<< " of an already-existing ShipDesign " << existing->Name();
<< " tried to rename a ShipDesign with an id, " << existing_design_id
<< " that does not exist";
return false;
}

Expand Down

0 comments on commit bcfceb9

Please sign in to comment.