aboutsummaryrefslogtreecommitdiff
path: root/src/script/cpp_api
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2020-10-18 13:16:09 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2020-10-18 13:16:09 +0200
commitc1aea404b862256e6bf9316eeb8f32c72b78a4c2 (patch)
treec85049475ebac3b891521caf0fd69de40060bb2d /src/script/cpp_api
parent3a718f12b433ef3980c8fc6e29957595110cd8f4 (diff)
downloaddragonfireclient-c1aea404b862256e6bf9316eeb8f32c72b78a4c2.tar.xz
Lint is bitch
Diffstat (limited to 'src/script/cpp_api')
-rw-r--r--src/script/cpp_api/s_cheats.cpp10
-rw-r--r--src/script/cpp_api/s_cheats.h5
2 files changed, 8 insertions, 7 deletions
diff --git a/src/script/cpp_api/s_cheats.cpp b/src/script/cpp_api/s_cheats.cpp
index 4ad62f2fe..45b75ff6d 100644
--- a/src/script/cpp_api/s_cheats.cpp
+++ b/src/script/cpp_api/s_cheats.cpp
@@ -23,14 +23,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "settings.h"
ScriptApiCheatsCheat::ScriptApiCheatsCheat(
- const std::string &name, const std::string &setting) :
+ const std::string &name, const std::string &setting) :
m_name(name),
m_setting(setting), m_function_ref(0)
{
}
-ScriptApiCheatsCheat::ScriptApiCheatsCheat(const std::string &name, const int &function) :
+ScriptApiCheatsCheat::ScriptApiCheatsCheat(const std::string &name, const int &function) :
m_name(name), m_setting(""), m_function_ref(function)
{
}
@@ -53,8 +53,7 @@ void ScriptApiCheatsCheat::toggle(lua_State *L, int error_handler)
g_settings->setBool(m_setting, !is_enabled());
}
-ScriptApiCheatsCategory::ScriptApiCheatsCategory(const std::string &name) :
- m_name(name)
+ScriptApiCheatsCategory::ScriptApiCheatsCategory(const std::string &name) : m_name(name)
{
}
@@ -102,7 +101,8 @@ void ScriptApiCheats::init_cheats()
lua_pushnil(L);
while (lua_next(L, -2)) {
if (lua_istable(L, -1)) {
- ScriptApiCheatsCategory *category = new ScriptApiCheatsCategory(lua_tostring(L, -2));
+ ScriptApiCheatsCategory *category =
+ new ScriptApiCheatsCategory(lua_tostring(L, -2));
category->read_cheats(L);
m_cheat_categories.push_back(category);
}
diff --git a/src/script/cpp_api/s_cheats.h b/src/script/cpp_api/s_cheats.h
index a93768659..9b5ace3e7 100644
--- a/src/script/cpp_api/s_cheats.h
+++ b/src/script/cpp_api/s_cheats.h
@@ -31,6 +31,7 @@ public:
std::string m_name;
bool is_enabled();
void toggle(lua_State *L, int error_handler);
+
private:
std::string m_setting;
int m_function_ref;
@@ -43,7 +44,7 @@ public:
~ScriptApiCheatsCategory();
std::string m_name;
void read_cheats(lua_State *L);
- std::vector<ScriptApiCheatsCheat*> m_cheats;
+ std::vector<ScriptApiCheatsCheat *> m_cheats;
};
class ScriptApiCheats : virtual public ScriptApiBase
@@ -53,5 +54,5 @@ public:
void init_cheats();
void toggle_cheat(ScriptApiCheatsCheat *cheat);
bool m_cheats_loaded = false;
- std::vector<ScriptApiCheatsCategory*> m_cheat_categories;
+ std::vector<ScriptApiCheatsCategory *> m_cheat_categories;
};