From 7adcebc1378d3dc94176b2a7b495aed6a25eceb4 Mon Sep 17 00:00:00 2001 From: placki Date: Wed, 2 Nov 2011 14:38:43 +0100 Subject: [PATCH] Message for borderstone protected area --- src/game.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index 91714e1..768b5fa 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1798,10 +1798,10 @@ void the_game( NodeMetadata *meta = client.getNodeMetadata(nodepos); if(meta) { - //HACK: server should not be sending teleport info to clients at all... + //maybe server should not be sending teleport info to clients at all? infotext = narrow_to_wide(meta->infoText()); - MapNode n = client.getNode(nodepos); - if(n.getContent() == CONTENT_TELEPORT) + content_t content = map->getNodeNoEx(nodepos).getContent(); + if(content == CONTENT_TELEPORT) { // meta/infotext contains text inside "" quotes. // find 3rd comma @@ -1824,6 +1824,17 @@ void the_game( infotext = infotext.substr(0,infotext.length()-1)+L",Unnamed\""; } } + else + if(content == CONTENT_BORDERSTONE) + { char ts[50]; + v3s16 tp=getContainerPos(nodepos,MAP_BLOCKSIZE); + tp*=MAP_BLOCKSIZE; + snprintf(ts, 50, "Protected area: %i<=X<%i, %i<=Y<%i, %i<=Z<%i", + tp.X,tp.X+MAP_BLOCKSIZE, + tp.Y,tp.Y+MAP_BLOCKSIZE, + tp.Z,tp.Z+MAP_BLOCKSIZE); + infotext=narrow_to_wide(ts).c_str(); + } } //MapNode node = client.getNode(nodepos);