1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-12 16:58:39 +00:00

C++11 patchset 9: move hardcoded init parameters to class definitions (part 1) (#5984)

* C++11 patchset 9: move hardcoded init parameters to class definitions

C++11 introduced the possibility to define the default values directly in class definitions, do it on current code

Also remove some unused attributes

* CollisionInfo::bouncy
* collisionMoveResult::collides_xy
* collisionMoveResult::standing_on_unloaded
* Clouds::speed

* More constructor cleanups + some variables removal

* remove only write guiFormSpecMenu::m_old_tooltip
* move header included inside defintions in genericobject.h
* remove some unused since years exception classes
* remove unused & empty debug_stacks_init
* remove unused & empty content_nodemeta_serialize_legacy
* remove forgotten useless bool (bouncy) in collision.cpp code
This commit is contained in:
Loïc Blot 2017-06-16 11:25:52 +02:00 committed by GitHub
parent 49d6e5f4ab
commit 76be103a91
50 changed files with 331 additions and 751 deletions

View file

@ -106,19 +106,7 @@ TestSAO proto_TestSAO(NULL, v3f(0,0,0));
*/
UnitSAO::UnitSAO(ServerEnvironment *env, v3f pos):
ServerActiveObject(env, pos),
m_hp(-1),
m_yaw(0),
m_properties_sent(true),
m_armor_groups_sent(false),
m_animation_range(0,0),
m_animation_speed(0),
m_animation_blend(0),
m_animation_loop(true),
m_animation_sent(false),
m_bone_position_sent(false),
m_attachment_parent_id(0),
m_attachment_sent(false)
ServerActiveObject(env, pos)
{
// Initialize something to armor groups
m_armor_groups["fleshy"] = 100;
@ -239,16 +227,7 @@ LuaEntitySAO::LuaEntitySAO(ServerEnvironment *env, v3f pos,
const std::string &name, const std::string &state):
UnitSAO(env, pos),
m_init_name(name),
m_init_state(state),
m_registered(false),
m_velocity(0,0,0),
m_acceleration(0,0,0),
m_last_sent_yaw(0),
m_last_sent_position(0,0,0),
m_last_sent_velocity(0,0,0),
m_last_sent_position_timer(0),
m_last_sent_move_precision(0),
m_current_texture_modifier("")
m_init_state(state)
{
// Only register type if no environment supplied
if(env == NULL){
@ -783,29 +762,7 @@ PlayerSAO::PlayerSAO(ServerEnvironment *env_, RemotePlayer *player_, u16 peer_id
UnitSAO(env_, v3f(0,0,0)),
m_player(player_),
m_peer_id(peer_id_),
m_inventory(NULL),
m_damage(0),
m_last_good_position(0,0,0),
m_time_from_last_teleport(0),
m_time_from_last_punch(0),
m_nocheat_dig_pos(32767, 32767, 32767),
m_nocheat_dig_time(0),
m_wield_index(0),
m_position_not_sent(false),
m_is_singleplayer(is_singleplayer),
m_breath(PLAYER_MAX_BREATH),
m_pitch(0),
m_fov(0),
m_wanted_range(0),
m_extended_attributes_modified(false),
// public
m_physics_override_speed(1),
m_physics_override_jump(1),
m_physics_override_gravity(1),
m_physics_override_sneak(true),
m_physics_override_sneak_glitch(false),
m_physics_override_new_move(true),
m_physics_override_sent(false)
m_is_singleplayer(is_singleplayer)
{
assert(m_peer_id != 0); // pre-condition