Remove unneeded ObjectRef setter return values (#12179)

This commit is contained in:
Lars Müller 2022-04-10 23:20:51 +02:00 committed by GitHub
parent 2d8eac4e0a
commit 1f27bf6380
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 31 deletions

View File

@ -7023,7 +7023,6 @@ object you are working with still exists.
* `light_definition` is a table with the following optional fields: * `light_definition` is a table with the following optional fields:
* `shadows` is a table that controls ambient shadows * `shadows` is a table that controls ambient shadows
* `intensity` sets the intensity of the shadows from 0 (no shadows, default) to 1 (blackness) * `intensity` sets the intensity of the shadows from 0 (no shadows, default) to 1 (blackness)
* Returns true on success.
* `get_lighting()`: returns the current state of lighting for the player. * `get_lighting()`: returns the current state of lighting for the player.
* Result is a table with the same fields as `light_definition` in `set_lighting`. * Result is a table with the same fields as `light_definition` in `set_lighting`.

View File

@ -420,8 +420,7 @@ int ObjectRef::l_set_local_animation(lua_State *L)
float frame_speed = readParam<float>(L, 6, 30.0f); float frame_speed = readParam<float>(L, 6, 30.0f);
getServer(L)->setLocalPlayerAnimations(player, frames, frame_speed); getServer(L)->setLocalPlayerAnimations(player, frames, frame_speed);
lua_pushboolean(L, true); return 0;
return 1;
} }
// get_local_animation(self) // get_local_animation(self)
@ -464,8 +463,7 @@ int ObjectRef::l_set_eye_offset(lua_State *L)
offset_third.Y = rangelim(offset_third.Y,-10,15); //1.5*BS offset_third.Y = rangelim(offset_third.Y,-10,15); //1.5*BS
getServer(L)->setPlayerEyeOffset(player, offset_first, offset_third); getServer(L)->setPlayerEyeOffset(player, offset_first, offset_third);
lua_pushboolean(L, true); return 0;
return 1;
} }
// get_eye_offset(self) // get_eye_offset(self)
@ -737,8 +735,7 @@ int ObjectRef::l_set_nametag_attributes(lua_State *L)
prop->validate(); prop->validate();
sao->notifyObjectPropertiesModified(); sao->notifyObjectPropertiesModified();
lua_pushboolean(L, true); return 0;
return 1;
} }
// get_nametag_attributes(self) // get_nametag_attributes(self)
@ -1116,7 +1113,7 @@ int ObjectRef::l_set_look_vertical(lua_State *L)
float pitch = readParam<float>(L, 2) * core::RADTODEG; float pitch = readParam<float>(L, 2) * core::RADTODEG;
playersao->setLookPitchAndSend(pitch); playersao->setLookPitchAndSend(pitch);
return 1; return 0;
} }
// set_look_horizontal(self, radians) // set_look_horizontal(self, radians)
@ -1131,7 +1128,7 @@ int ObjectRef::l_set_look_horizontal(lua_State *L)
float yaw = readParam<float>(L, 2) * core::RADTODEG; float yaw = readParam<float>(L, 2) * core::RADTODEG;
playersao->setPlayerYawAndSend(yaw); playersao->setPlayerYawAndSend(yaw);
return 1; return 0;
} }
// DEPRECATED // DEPRECATED
@ -1151,7 +1148,7 @@ int ObjectRef::l_set_look_pitch(lua_State *L)
float pitch = readParam<float>(L, 2) * core::RADTODEG; float pitch = readParam<float>(L, 2) * core::RADTODEG;
playersao->setLookPitchAndSend(pitch); playersao->setLookPitchAndSend(pitch);
return 1; return 0;
} }
// DEPRECATED // DEPRECATED
@ -1171,7 +1168,7 @@ int ObjectRef::l_set_look_yaw(lua_State *L)
float yaw = readParam<float>(L, 2) * core::RADTODEG; float yaw = readParam<float>(L, 2) * core::RADTODEG;
playersao->setPlayerYawAndSend(yaw); playersao->setPlayerYawAndSend(yaw);
return 1; return 0;
} }
// set_fov(self, degrees, is_multiplier, transition_time) // set_fov(self, degrees, is_multiplier, transition_time)
@ -1310,8 +1307,7 @@ int ObjectRef::l_set_inventory_formspec(lua_State *L)
player->inventory_formspec = formspec; player->inventory_formspec = formspec;
getServer(L)->reportInventoryFormspecModified(player->getName()); getServer(L)->reportInventoryFormspecModified(player->getName());
lua_pushboolean(L, true); return 0;
return 1;
} }
// get_inventory_formspec(self) -> formspec // get_inventory_formspec(self) -> formspec
@ -1342,8 +1338,7 @@ int ObjectRef::l_set_formspec_prepend(lua_State *L)
player->formspec_prepend = formspec; player->formspec_prepend = formspec;
getServer(L)->reportFormspecPrependModified(player->getName()); getServer(L)->reportFormspecPrependModified(player->getName());
lua_pushboolean(L, true); return 0;
return 1;
} }
// get_formspec_prepend(self) // get_formspec_prepend(self)
@ -1603,8 +1598,7 @@ int ObjectRef::l_hud_set_flags(lua_State *L)
if (!getServer(L)->hudSetFlags(player, flags, mask)) if (!getServer(L)->hudSetFlags(player, flags, mask))
return 0; return 0;
lua_pushboolean(L, true); return 0;
return 1;
} }
// hud_get_flags(self) // hud_get_flags(self)
@ -1861,8 +1855,7 @@ int ObjectRef::l_set_sky(lua_State *L)
} }
getServer(L)->setSky(player, sky_params); getServer(L)->setSky(player, sky_params);
lua_pushboolean(L, true); return 0;
return 1;
} }
static void push_sky_color(lua_State *L, const SkyboxParams &params) static void push_sky_color(lua_State *L, const SkyboxParams &params)
@ -1984,8 +1977,7 @@ int ObjectRef::l_set_sun(lua_State *L)
} }
getServer(L)->setSun(player, sun_params); getServer(L)->setSun(player, sun_params);
lua_pushboolean(L, true); return 0;
return 1;
} }
//get_sun(self) //get_sun(self)
@ -2038,8 +2030,7 @@ int ObjectRef::l_set_moon(lua_State *L)
} }
getServer(L)->setMoon(player, moon_params); getServer(L)->setMoon(player, moon_params);
lua_pushboolean(L, true); return 0;
return 1;
} }
// get_moon(self) // get_moon(self)
@ -2094,8 +2085,7 @@ int ObjectRef::l_set_stars(lua_State *L)
} }
getServer(L)->setStars(player, star_params); getServer(L)->setStars(player, star_params);
lua_pushboolean(L, true); return 0;
return 1;
} }
// get_stars(self) // get_stars(self)
@ -2162,8 +2152,7 @@ int ObjectRef::l_set_clouds(lua_State *L)
} }
getServer(L)->setClouds(player, cloud_params); getServer(L)->setClouds(player, cloud_params);
lua_pushboolean(L, true); return 0;
return 1;
} }
int ObjectRef::l_get_clouds(lua_State *L) int ObjectRef::l_get_clouds(lua_State *L)
@ -2217,8 +2206,7 @@ int ObjectRef::l_override_day_night_ratio(lua_State *L)
} }
getServer(L)->overrideDayNightRatio(player, do_override, ratio); getServer(L)->overrideDayNightRatio(player, do_override, ratio);
lua_pushboolean(L, true); return 0;
return 1;
} }
// get_day_night_ratio(self) // get_day_night_ratio(self)
@ -2313,8 +2301,7 @@ int ObjectRef::l_set_lighting(lua_State *L)
lua_pop(L, -1); lua_pop(L, -1);
getServer(L)->setLighting(player, lighting); getServer(L)->setLighting(player, lighting);
lua_pushboolean(L, true); return 0;
return 1;
} }
// get_lighting(self) // get_lighting(self)