1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Move std::tie out of headers

This commit is contained in:
DS 2024-09-14 12:10:11 +02:00 committed by GitHub
parent a6219ab955
commit c54f5a2137
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 45 additions and 41 deletions

View file

@ -28,6 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "settings.h"
#include "log.h"
#include "porting.h" // strlcpy
#include <tuple>
bool is_valid_player_name(std::string_view name) {
@ -229,3 +230,19 @@ void PlayerControl::unpackKeysPressed(u32 keypress_bits)
place = keypress_bits & (1 << 8);
zoom = keypress_bits & (1 << 9);
}
static auto tie(const PlayerPhysicsOverride &o)
{
// Make sure to add new members to this list!
return std::tie(
o.speed, o.jump, o.gravity, o.sneak, o.sneak_glitch, o.new_move, o.speed_climb,
o.speed_crouch, o.liquid_fluidity, o.liquid_fluidity_smooth, o.liquid_sink,
o.acceleration_default, o.acceleration_air, o.speed_fast, o.acceleration_fast,
o.speed_walk
);
}
bool PlayerPhysicsOverride::operator==(const PlayerPhysicsOverride &other) const
{
return tie(*this) == tie(other);
}