mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
Various style cleanups + unused code removal
-> Don't pass pointer to whole IGameDef to NodeMetadata constructors and deserializers, but only to IItemDefManager, which is needed -> Remove the unused content_mapnode_get_new_name() method -> Fix style for MapBlock::deSerialize and MapBlock::deSerialize_pre22, improving accuracy of error messages a bit -> Fix style at other serialisation methods too -> Improve accuracy of some comments
This commit is contained in:
@@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
#include "common/c_content.h"
|
||||
#include "environment.h"
|
||||
#include "map.h"
|
||||
#include "gamedef.h"
|
||||
#include "nodemetadata.h"
|
||||
|
||||
|
||||
@@ -43,7 +44,7 @@ NodeMetadata* NodeMetaRef::getmeta(NodeMetaRef *ref, bool auto_create)
|
||||
{
|
||||
NodeMetadata *meta = ref->m_env->getMap().getNodeMetadata(ref->m_p);
|
||||
if(meta == NULL && auto_create) {
|
||||
meta = new NodeMetadata(ref->m_env->getGameDef());
|
||||
meta = new NodeMetadata(ref->m_env->getGameDef()->idef());
|
||||
if(!ref->m_env->getMap().setNodeMetadata(ref->m_p, meta)) {
|
||||
delete meta;
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user