mirror of
https://github.com/moparisthebest/minetest
synced 2024-11-15 22:05:07 -05:00
remove content_* things from map.cpp
This commit is contained in:
parent
79cb754358
commit
8b875d71d1
@ -77,8 +77,8 @@ public:
|
|||||||
virtual bool nodeRemovalDisabled();
|
virtual bool nodeRemovalDisabled();
|
||||||
virtual std::string getInventoryDrawSpecString();
|
virtual std::string getInventoryDrawSpecString();
|
||||||
|
|
||||||
std::string getOwner(){ return m_text; }
|
virtual std::string getOwner(){ return m_text; }
|
||||||
void setOwner(std::string t){ m_text = t; }
|
virtual void setOwner(std::string t){ m_text = t; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Inventory *m_inventory;
|
Inventory *m_inventory;
|
||||||
|
15
src/map.cpp
15
src/map.cpp
@ -28,8 +28,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||||||
#include "porting.h"
|
#include "porting.h"
|
||||||
#include "mapgen.h"
|
#include "mapgen.h"
|
||||||
#include "nodemetadata.h"
|
#include "nodemetadata.h"
|
||||||
#include "content_nodemeta.h"
|
|
||||||
#include "content_mapnode.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
SQLite format specification:
|
SQLite format specification:
|
||||||
@ -1016,20 +1014,9 @@ void Map::addNodeAndUpdate(v3s16 p, MapNode n,
|
|||||||
if(meta_proto)
|
if(meta_proto)
|
||||||
{
|
{
|
||||||
NodeMetadata *meta = meta_proto->clone();
|
NodeMetadata *meta = meta_proto->clone();
|
||||||
/* lockable chest, insert the owner's name */
|
meta->setOwner(player_name);
|
||||||
if (meta->typeId() == CONTENT_LOCKABLE_CHEST)
|
|
||||||
{
|
|
||||||
LockingChestNodeMetadata *lcm = (LockingChestNodeMetadata*)meta;
|
|
||||||
lcm->setOwner(player_name);
|
|
||||||
}
|
|
||||||
setNodeMetadata(p, meta);
|
setNodeMetadata(p, meta);
|
||||||
}
|
}
|
||||||
else if (n.getContent() == CONTENT_LOCKABLE_CHEST)
|
|
||||||
{
|
|
||||||
LockingChestNodeMetadata *lcm = new LockingChestNodeMetadata();
|
|
||||||
lcm->setOwner(player_name);
|
|
||||||
setNodeMetadata(p, (NodeMetadata*)lcm);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
If node is under sunlight and doesn't let sunlight through,
|
If node is under sunlight and doesn't let sunlight through,
|
||||||
|
@ -65,6 +65,9 @@ public:
|
|||||||
// Used to make custom inventory menus.
|
// Used to make custom inventory menus.
|
||||||
// See format in guiInventoryMenu.cpp.
|
// See format in guiInventoryMenu.cpp.
|
||||||
virtual std::string getInventoryDrawSpecString(){return "";}
|
virtual std::string getInventoryDrawSpecString(){return "";}
|
||||||
|
// primarily used for locking chests, but others can play too
|
||||||
|
virtual std::string getOwner(){ return std::string(""); }
|
||||||
|
virtual void setOwner(std::string t){ }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void registerType(u16 id, Factory f);
|
static void registerType(u16 id, Factory f);
|
||||||
|
Loading…
Reference in New Issue
Block a user