aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_localplayer.cpp
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2020-11-04 16:57:41 +0100
committerElias Fleckenstein <eliasfleckenstein@web.de>2020-11-04 16:57:41 +0100
commit6ccb5835ff55d85156be91473c598eca9d6cb9a6 (patch)
tree7f1eaf8b94694c8e24e206909ba8f55a1ebfbb3e /src/script/lua_api/l_localplayer.cpp
parent244713971a976e43e8740b6a9d9d122e37020ef2 (diff)
downloaddragonfireclient-6ccb5835ff55d85156be91473c598eca9d6cb9a6.tar.xz
Revert "Make Lint Happy"
This reverts commit ad148587dcf5244c2d2011dba339786c765c54c4.
Diffstat (limited to 'src/script/lua_api/l_localplayer.cpp')
-rw-r--r--src/script/lua_api/l_localplayer.cpp33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/script/lua_api/l_localplayer.cpp b/src/script/lua_api/l_localplayer.cpp
index 789b3a3f0..e40dd7b37 100644
--- a/src/script/lua_api/l_localplayer.cpp
+++ b/src/script/lua_api/l_localplayer.cpp
@@ -66,10 +66,10 @@ int LuaLocalPlayer::l_get_velocity(lua_State *L)
int LuaLocalPlayer::l_set_velocity(lua_State *L)
{
LocalPlayer *player = getobject(L, 1);
-
+
v3f pos = checkFloatPos(L, 2);
player->setSpeed(pos);
-
+
return 0;
}
@@ -91,7 +91,7 @@ int LuaLocalPlayer::l_set_yaw(lua_State *L)
g_game->cam_view.camera_yaw = yaw;
g_game->cam_view_target.camera_yaw = yaw;
}
-
+
return 0;
}
@@ -125,7 +125,7 @@ int LuaLocalPlayer::l_set_wield_index(lua_State *L)
{
LocalPlayer *player = getobject(L, 1);
u32 index = luaL_checkinteger(L, 2) - 1;
-
+
player->setWieldIndex(index);
g_game->processItemSelection(&g_game->runData.new_playeritem);
ItemStack selected_item, hand_item;
@@ -266,7 +266,7 @@ int LuaLocalPlayer::l_get_control(lua_State *L)
LocalPlayer *player = getobject(L, 1);
const PlayerControl &c = player->getPlayerControl();
- auto set = [L](const char *name, bool value) {
+ auto set = [L] (const char *name, bool value) {
lua_pushboolean(L, value);
lua_setfield(L, -2, name);
};
@@ -308,7 +308,7 @@ int LuaLocalPlayer::l_get_pos(lua_State *L)
int LuaLocalPlayer::l_set_pos(lua_State *L)
{
LocalPlayer *player = getobject(L, 1);
-
+
v3f pos = checkFloatPos(L, 2);
player->setPosition(pos);
getClient(L)->sendPlayerPos();
@@ -522,10 +522,13 @@ void LuaLocalPlayer::Register(lua_State *L)
}
const char LuaLocalPlayer::className[] = "LocalPlayer";
-const luaL_Reg LuaLocalPlayer::methods[] = {luamethod(LuaLocalPlayer, get_velocity),
+const luaL_Reg LuaLocalPlayer::methods[] = {
+ luamethod(LuaLocalPlayer, get_velocity),
luamethod(LuaLocalPlayer, set_velocity),
- luamethod(LuaLocalPlayer, get_yaw), luamethod(LuaLocalPlayer, set_yaw),
- luamethod(LuaLocalPlayer, get_hp), luamethod(LuaLocalPlayer, get_name),
+ luamethod(LuaLocalPlayer, get_yaw),
+ luamethod(LuaLocalPlayer, set_yaw),
+ luamethod(LuaLocalPlayer, get_hp),
+ luamethod(LuaLocalPlayer, get_name),
luamethod(LuaLocalPlayer, get_wield_index),
luamethod(LuaLocalPlayer, set_wield_index),
luamethod(LuaLocalPlayer, get_wielded_item),
@@ -544,14 +547,18 @@ const luaL_Reg LuaLocalPlayer::methods[] = {luamethod(LuaLocalPlayer, get_veloci
luamethod(LuaLocalPlayer, get_last_look_vertical),
//
luamethod(LuaLocalPlayer, get_control),
- luamethod(LuaLocalPlayer, get_breath), luamethod(LuaLocalPlayer, get_pos),
+ luamethod(LuaLocalPlayer, get_breath),
+ luamethod(LuaLocalPlayer, get_pos),
luamethod(LuaLocalPlayer, set_pos),
luamethod(LuaLocalPlayer, get_movement_acceleration),
luamethod(LuaLocalPlayer, get_movement_speed),
luamethod(LuaLocalPlayer, get_movement),
luamethod(LuaLocalPlayer, get_armor_groups),
- luamethod(LuaLocalPlayer, hud_add), luamethod(LuaLocalPlayer, hud_remove),
- luamethod(LuaLocalPlayer, hud_change), luamethod(LuaLocalPlayer, hud_get),
+ luamethod(LuaLocalPlayer, hud_add),
+ luamethod(LuaLocalPlayer, hud_remove),
+ luamethod(LuaLocalPlayer, hud_change),
+ luamethod(LuaLocalPlayer, hud_get),
luamethod(LuaLocalPlayer, get_object),
- {0, 0}};
+ {0, 0}
+};