mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 00:25:19 +02:00
ObjDefManager: Set replacement object's handle info after calling set()
Make gamedef optional when constructing an ObjDefManager Add note about object ownership
This commit is contained in:
@@ -206,12 +206,15 @@ public:
|
||||
std::string name;
|
||||
};
|
||||
|
||||
// WARNING: Ownership of ObjDefs is transferred to the ObjDefManager it is
|
||||
// added/set to. Note that ObjDefs managed by ObjDefManager are NOT refcounted,
|
||||
// so the same ObjDef instance must not be referenced multiple
|
||||
class ObjDefManager {
|
||||
public:
|
||||
ObjDefManager(IGameDef *gamedef, ObjDefType type);
|
||||
virtual ~ObjDefManager();
|
||||
|
||||
virtual const char *getObjectTitle() const = 0;
|
||||
virtual const char *getObjectTitle() const { return "ObjDef"; }
|
||||
|
||||
virtual void clear();
|
||||
virtual ObjDef *getByName(const std::string &name) const;
|
||||
|
Reference in New Issue
Block a user