diff options
author | kwolekr <kwolekr@minetest.net> | 2015-05-03 22:05:24 -0400 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2015-05-03 22:19:35 -0400 |
commit | 5b237b4d94cc3fa4a95f951654dfbe37dcf2e2f9 (patch) | |
tree | 44c81991d6d4956e1ca4cadb7ac90ad17ae78e19 /src/mapgen.h | |
parent | 5704fb36d208e250490e6fb56268e75e0b9b3290 (diff) | |
download | minetest-5b237b4d94cc3fa4a95f951654dfbe37dcf2e2f9.tar.gz minetest-5b237b4d94cc3fa4a95f951654dfbe37dcf2e2f9.tar.bz2 minetest-5b237b4d94cc3fa4a95f951654dfbe37dcf2e2f9.zip |
ObjDefManager: Set replacement object's handle info after calling set()
Make gamedef optional when constructing an ObjDefManager
Add note about object ownership
Diffstat (limited to 'src/mapgen.h')
-rw-r--r-- | src/mapgen.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mapgen.h b/src/mapgen.h index ee7e8227e..5be004e9f 100644 --- a/src/mapgen.h +++ b/src/mapgen.h @@ -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; |