Skip to content

Commit

Permalink
Fix Compile
Browse files Browse the repository at this point in the history
  • Loading branch information
Corlyone committed Sep 11, 2023
1 parent bc4fdae commit 4cac519
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 16 deletions.
1 change: 1 addition & 0 deletions src/definitions.h
Expand Up @@ -66,6 +66,7 @@ static constexpr auto AUTHENTICATOR_PERIOD = 30U;
#pragma warning(disable:4351) // new behavior: elements of array will be default initialized
#pragma warning(disable:4458) // declaration hides class member
#pragma warning(disable:4996) // inet_addr conversion
#pragma warning(disable:4275) // can be ignored in Visual C++ if you are deriving from a type in the C++ STL
#endif

#define strcasecmp _stricmp
Expand Down
4 changes: 1 addition & 3 deletions src/enums.h
Expand Up @@ -385,9 +385,7 @@ enum PlayerSex_t : uint8_t {
PLAYERSEX_LAST = PLAYERSEX_MALE
};

enum Vocation_t : uint16_t {
VOCATION_NONE = 0
};
inline constexpr uint16_t VOCATION_NONE = 0;

enum ReturnValue {
RETURNVALUE_NOERROR,
Expand Down
13 changes: 10 additions & 3 deletions src/iomapserialize.cpp
Expand Up @@ -23,7 +23,12 @@
#include "game.h"
#include "bed.h"

#include <fmt/format.h>
#if __has_include("fmt/core.h")
#include <fmt/core.h>
#else
#include <fmt/format.h>
#endif


extern Game g_game;

Expand Down Expand Up @@ -328,15 +333,17 @@ bool IOMapSerialize::saveHouseInfo()

std::string listText;
if (house->getAccessList(GUEST_LIST, listText) && !listText.empty()) {
if (!stmt.addRow(fmt::format("{:d}, {}, {:s}", house->getId(), GUEST_LIST, db.escapeString(listText)))) {
if (!stmt.addRow(fmt::format("{:d}, {:d}, {:s}", house->getId(), static_cast<uint16_t>(GUEST_LIST),
db.escapeString(listText)))) {
return false;
}

listText.clear();
}

if (house->getAccessList(SUBOWNER_LIST, listText) && !listText.empty()) {
if (!stmt.addRow(fmt::format("{:d}, {}, {:s}", house->getId(), SUBOWNER_LIST, db.escapeString(listText)))) {
if (!stmt.addRow(fmt::format("{:d}, {:d}, {:s}", house->getId(), static_cast<uint16_t>(SUBOWNER_LIST),
db.escapeString(listText)))) {
return false;
}

Expand Down
7 changes: 3 additions & 4 deletions src/script.cpp
Expand Up @@ -18,10 +18,9 @@
*/

#include "otpch.h"

#include "script.h"
#include <boost/filesystem.hpp>
#include "configmanager.h"
#include "script.h"
#include <filesystem>

extern LuaEnvironment g_luaEnvironment;
extern ConfigManager g_config;
Expand All @@ -39,7 +38,7 @@ Scripts::~Scripts()

bool Scripts::loadScripts(std::string folderName, bool isLib, bool reload)
{
namespace fs = boost::filesystem;
namespace fs = std::filesystem;

const auto dir = fs::current_path() / "data" / folderName;
if(!fs::exists(dir) || !fs::is_directory(dir)) {
Expand Down
1 change: 1 addition & 0 deletions src/server.h
Expand Up @@ -29,6 +29,7 @@ class Protocol;
class ServiceBase
{
public:
virtual ~ServiceBase() = default;
virtual bool is_single_socket() const = 0;
virtual bool is_checksummed() const = 0;
virtual uint8_t get_protocol_identifier() const = 0;
Expand Down
8 changes: 2 additions & 6 deletions src/spells.h
Expand Up @@ -202,15 +202,11 @@ class Spell : public BaseSpell
vocSpellMap[n] = b;
}

const SpellGroup_t getGroup() const {
return group;
}
SpellGroup_t getGroup() const { return group; }
void setGroup(SpellGroup_t g) {
group = g;
}
const SpellGroup_t getSecondaryGroup() const {
return secondaryGroup;
}
SpellGroup_t getSecondaryGroup() const { return secondaryGroup; }
void setSecondaryGroup(SpellGroup_t g) {
secondaryGroup = g;
}
Expand Down
1 change: 1 addition & 0 deletions src/tools.h
Expand Up @@ -96,4 +96,5 @@ int64_t OTSYS_TIME();

SpellGroup_t stringToSpellGroup(const std::string& value);


#endif

0 comments on commit 4cac519

Please sign in to comment.