From d6b30dd3a5df4b84a287305f807442064f4cf68d Mon Sep 17 00:00:00 2001 From: Kahrl Date: Tue, 29 Nov 2011 17:15:18 +0200 Subject: CraftItem rework and Lua interface --- src/utility.cpp | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) (limited to 'src/utility.cpp') diff --git a/src/utility.cpp b/src/utility.cpp index 7ffbe7160..87c81cb2a 100644 --- a/src/utility.cpp +++ b/src/utility.cpp @@ -276,3 +276,103 @@ std::string translatePassword(std::string playername, std::wstring password) +PointedThing::PointedThing(): + type(POINTEDTHING_NOTHING), + node_undersurface(0,0,0), + node_abovesurface(0,0,0), + object_id(-1) +{} + +std::string PointedThing::dump() const +{ + std::ostringstream os(std::ios::binary); + if(type == POINTEDTHING_NOTHING) + { + os<<"[nothing]"; + } + else if(type == POINTEDTHING_NODE) + { + const v3s16 &u = node_undersurface; + const v3s16 &a = node_abovesurface; + os<<"[node under="<