1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-11-23 09:45:19 +01:00

Fix memory leak in rollback (and more) (#16644)

This commit is contained in:
sfan5
2025-11-05 11:55:57 +01:00
committed by GitHub
parent 7a6e639d61
commit 2368126d0a
4 changed files with 43 additions and 40 deletions

View File

@@ -22,12 +22,15 @@ struct RollbackNode
int param2 = 0;
std::string meta;
bool operator == (const RollbackNode &other)
bool operator == (const RollbackNode &other) const
{
return (name == other.name && param1 == other.param1 &&
param2 == other.param2 && meta == other.meta);
}
bool operator != (const RollbackNode &other) { return !(*this == other); }
bool operator != (const RollbackNode &other) const
{
return !(*this == other);
}
RollbackNode() = default;
@@ -37,15 +40,16 @@ struct RollbackNode
struct RollbackAction
{
enum Type{
enum Type : u8 {
TYPE_NOTHING,
TYPE_SET_NODE,
TYPE_MODIFY_INVENTORY_STACK,
} type = TYPE_NOTHING;
};
time_t unix_time = 0;
std::string actor;
bool actor_is_guess = false;
Type type = TYPE_NOTHING;
v3s16 p;
RollbackNode n_old;