Skip to content

Instantly share code, notes, and snippets.

@xyzz
Created November 1, 2012 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xyzz/3994872 to your computer and use it in GitHub Desktop.
Save xyzz/3994872 to your computer and use it in GitHub Desktop.
diff --git a/src/content_sao.cpp b/src/content_sao.cpp
index 7526e03..9a4ce74 100644
--- a/src/content_sao.cpp
+++ b/src/content_sao.cpp
@@ -30,6 +30,7 @@
#include "scriptapi.h"
#include "genericobject.h"
#include "util/serialize.h"
+#include "map.h"
core::map<u16, ServerActiveObject::Factory> ServerActiveObject::m_types;
@@ -497,6 +498,18 @@ void LuaEntitySAO::step(float dtime, bool send_recommended)
ActiveObjectMessage aom(getId(), true, str);
m_messages_out.push_back(aom);
}
+
+ v3s16 block_pos(m_base_position.X/BS/16,
+ m_base_position.Y/BS/16,
+ m_base_position.Z/BS/16);
+ for (int x = -1; x <= 1; ++x)
+ for (int y = -1; y <= 1; ++y)
+ for (int z = -1; z <= 1; ++z) {
+ MapBlock *block = m_env->getMap().getBlockNoCreateNoEx(block_pos + v3s16(x, y, z));
+ if (block != NULL) {
+ block->resetUsageTimer();
+ }
+ }
}
std::string LuaEntitySAO::getClientInitializationData()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment