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

Add persistent unique identifiers for objects (#14135)

This commit is contained in:
sfence
2025-07-09 10:40:26 +02:00
committed by GitHub
parent e0f8243629
commit 4f42b4308c
20 changed files with 257 additions and 19 deletions

View File

@@ -6,6 +6,7 @@
#pragma once
#include "unit_sao.h"
#include "util/guid.h"
class LuaEntitySAO : public UnitSAO
{
@@ -15,11 +16,7 @@ public:
LuaEntitySAO(ServerEnvironment *env, v3f pos, const std::string &data);
// Used by the Lua API
LuaEntitySAO(ServerEnvironment *env, v3f pos, const std::string &name,
const std::string &state) :
UnitSAO(env, pos),
m_init_name(name), m_init_state(state)
{
}
const std::string &state);
~LuaEntitySAO();
ActiveObjectType getType() const { return ACTIVEOBJECT_TYPE_LUAENTITY; }
@@ -47,6 +44,7 @@ public:
void setHP(s32 hp, const PlayerHPChangeReason &reason);
u16 getHP() const;
std::string getGUID() const;
/* LuaEntitySAO-specific */
void setVelocity(v3f velocity);
@@ -86,6 +84,8 @@ private:
std::string m_init_state;
bool m_registered = false;
MyGUID m_guid;
v3f m_velocity;
v3f m_acceleration;