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 white and double spaces #3711

Merged
1 commit merged into from
Oct 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions src/actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,9 @@ static void showUseHotkeyMessage(Player* player, const Item* item, uint32_t coun
{
const ItemType& it = Item::items[item->getID()];
if (!it.showCount) {
player->sendTextMessage(MESSAGE_INFO_DESCR, fmt::format("Using one of {:s}...", item->getName()));
player->sendTextMessage(MESSAGE_INFO_DESCR, fmt::format("Using one of {:s}...", item->getName()));
} else if (count == 1) {
player->sendTextMessage(MESSAGE_INFO_DESCR, fmt::format("Using the last {:s}...", item->getName()));
player->sendTextMessage(MESSAGE_INFO_DESCR, fmt::format("Using the last {:s}...", item->getName()));
} else {
player->sendTextMessage(MESSAGE_INFO_DESCR, fmt::format("Using one of {:d} {:s}...", count, item->getPluralName()));
}
Expand Down
2 changes: 1 addition & 1 deletion src/condition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ int32_t ConditionAttributes::getParam(ConditionParam_t param)
case CONDITION_PARAM_SKILL_FISHING:
return skills[SKILL_FISHING];

case CONDITION_PARAM_SKILL_FISHINGPERCENT:
case CONDITION_PARAM_SKILL_FISHINGPERCENT:
return skillsPercent[SKILL_FISHING];

case CONDITION_PARAM_STAT_MAXHITPOINTS:
Expand Down
6 changes: 3 additions & 3 deletions src/const.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ enum MessageClasses : uint8_t {
MESSAGE_PARTY_MANAGEMENT = 34, /*White message in channel (+ channelId)*/
MESSAGE_PARTY = 35, /*White message in channel (+ channelId)*/
MESSAGE_EVENT_ORANGE = 36, /*Orange message in the console*/
MESSAGE_STATUS_CONSOLE_ORANGE = 37, /*Orange message in the console*/
MESSAGE_STATUS_CONSOLE_ORANGE = 37, /*Orange message in the console*/
};

enum FluidColors_t : uint8_t {
Expand Down Expand Up @@ -344,7 +344,7 @@ enum TextColor_t : uint8_t {
enum Icons_t {
ICON_POISON = 1 << 0,
ICON_BURN = 1 << 1,
ICON_ENERGY = 1 << 2,
ICON_ENERGY = 1 << 2,
ICON_DRUNK = 1 << 3,
ICON_MANASHIELD = 1 << 4,
ICON_PARALYZE = 1 << 5,
Expand Down Expand Up @@ -548,7 +548,7 @@ enum PlayerFlags : uint64_t {
PlayerFlag_IsAlwaysPremium = static_cast<uint64_t>(1) << 37,
};

enum ReloadTypes_t : uint8_t {
enum ReloadTypes_t : uint8_t {
RELOAD_TYPE_ALL,
RELOAD_TYPE_ACTIONS,
RELOAD_TYPE_CHAT,
Expand Down
16 changes: 8 additions & 8 deletions src/fileloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@ class PropStream;

namespace OTB {
using MappedFile = boost::iostreams::mapped_file_source;
using ContentIt = MappedFile::iterator;
using ContentIt = MappedFile::iterator;
using Identifier = std::array<char, 4>;

struct Node
{
using ChildrenVector = std::vector<Node>;

ChildrenVector children;
ContentIt propsBegin;
ContentIt propsEnd;
uint8_t type;
ContentIt propsBegin;
ContentIt propsEnd;
uint8_t type;
enum NodeChar: uint8_t
{
ESCAPE = 0xFD,
START = 0xFE,
END = 0xFF,
START = 0xFE,
END = 0xFF,
};
};

Expand All @@ -58,8 +58,8 @@ struct InvalidOTBFormat final : LoadError {
};

class Loader {
MappedFile fileContents;
Node root;
MappedFile fileContents;
Node root;
std::vector<char> propBuffer;
public:
Loader(const std::string& fileName, const Identifier& acceptedIdentifier);
Expand Down
2 changes: 1 addition & 1 deletion src/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ class Game

static constexpr uint8_t LIGHT_DAY = 250;
static constexpr uint8_t LIGHT_NIGHT = 40;
// 1h realtime = 1day worldtime
// 1h realtime = 1day worldtime
// 2.5s realtime = 1min worldtime
// worldTime is calculated in minutes
static constexpr int16_t GAME_SUNRISE = 360;
Expand Down
2 changes: 1 addition & 1 deletion src/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ class ItemAttributes
}

switch (pos) {
case 1: { // std::string
case 1: { // std::string
std::string tmp;
if (!propStream.readString(tmp)) {
return false;
Expand Down
12 changes: 6 additions & 6 deletions src/luascript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4206,17 +4206,17 @@ int LuaScriptInterface::luaTablePack(lua_State* L)
{
// table.pack(...)
int i;
int n = lua_gettop(L); /* number of elements to pack */
lua_createtable(L, n, 1); /* create result table */
lua_insert(L, 1); /* put it at index 1 */
for (i = n; i >= 1; i--) /* assign elements */
int n = lua_gettop(L); /* number of elements to pack */
lua_createtable(L, n, 1); /* create result table */
lua_insert(L, 1); /* put it at index 1 */
for (i = n; i >= 1; i--) /* assign elements */
lua_rawseti(L, 1, i);
if (luaL_callmeta(L, -1, "__index") != 0) {
lua_replace(L, -2);
}
lua_pushinteger(L, n);
lua_setfield(L, 1, "n"); /* t.n = number of elements */
return 1; /* return table */
lua_setfield(L, 1, "n"); /* t.n = number of elements */
return 1; /* return table */
}

// Game
Expand Down
2 changes: 1 addition & 1 deletion src/luascript.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class ScriptEnvironment
static DBResultMap tempResults;
};

#define reportErrorFunc(L, a) LuaScriptInterface::reportError(__FUNCTION__, a, L, true)
#define reportErrorFunc(L, a) LuaScriptInterface::reportError(__FUNCTION__, a, L, true)

enum ErrorCode_t {
LUA_ERROR_PLAYER_NOT_FOUND,
Expand Down
2 changes: 1 addition & 1 deletion src/mounts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ bool Mounts::loadFromXml()
for (auto mountNode : doc.child("mounts").children()) {
uint16_t nodeId = pugi::cast<uint16_t>(mountNode.attribute("id").value());
if (nodeId == 0 || nodeId > std::numeric_limits<uint8_t>::max()) {
std::cout << "[Notice - Mounts::loadFromXml] Mount id \"" << nodeId << "\" is not within 1 and 255 range" << std::endl;
std::cout << "[Notice - Mounts::loadFromXml] Mount id \"" << nodeId << "\" is not within 1 and 255 range" << std::endl;
continue;
}

Expand Down
4 changes: 2 additions & 2 deletions src/otserv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void printServerVersion()
{
#if defined(GIT_RETRIEVED_STATE) && GIT_RETRIEVED_STATE
std::cout << STATUS_SERVER_NAME << " - Version " << GIT_DESCRIBE << std::endl;
std::cout << "Git SHA1 " << GIT_SHORT_SHA1 << " dated " << GIT_COMMIT_DATE_ISO8601 << std::endl;
std::cout << "Git SHA1 " << GIT_SHORT_SHA1 << " dated " << GIT_COMMIT_DATE_ISO8601 << std::endl;
#if GIT_IS_DIRTY
std::cout << "*** DIRTY - NOT OFFICIAL RELEASE ***" << std::endl;
#endif
Expand All @@ -135,7 +135,7 @@ void printServerVersion()
#if defined(LUAJIT_VERSION)
std::cout << "Linked with " << LUAJIT_VERSION << " for Lua support" << std::endl;
#else
std::cout << "Linked with " << LUA_RELEASE << " for Lua support" << std::endl;
std::cout << "Linked with " << LUA_RELEASE << " for Lua support" << std::endl;
#endif
std::cout << std::endl;

Expand Down
2 changes: 1 addition & 1 deletion src/signals.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* The Forgotten Server - a free and open-source MMORPG server emulator
* Copyright (C) 2019 Mark Samman <mark.samman@gmail.com>
* Copyright (C) 2019 Mark Samman <mark.samman@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down