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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user