summaryrefslogtreecommitdiff
path: root/src/environment.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-09-09 17:12:29 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-09-09 17:12:29 +0300
commit9cadaf824b3a59c85ad03f9c7185f43724b8e7ff (patch)
tree81faa2491a264a29c626e560ccf58601ef02ebd3 /src/environment.cpp
parent1cc1b93e65d6d88e20786383cb09caf22a8c6494 (diff)
downloadminetest-9cadaf824b3a59c85ad03f9c7185f43724b8e7ff.tar.gz
minetest-9cadaf824b3a59c85ad03f9c7185f43724b8e7ff.tar.bz2
minetest-9cadaf824b3a59c85ad03f9c7185f43724b8e7ff.zip
Add dtime_s to entity activation
Diffstat (limited to 'src/environment.cpp')
-rw-r--r--src/environment.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/environment.cpp b/src/environment.cpp
index 10ebd4127..4abba6359 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -790,7 +790,7 @@ void ServerEnvironment::activateBlock(MapBlock *block, u32 additional_dtime)
<<dtime_s<<" seconds old."<<std::endl;*/
// Activate stored objects
- activateObjects(block);
+ activateObjects(block, dtime_s);
// Run node timers
std::map<v3s16, NodeTimer> elapsed_timers =
@@ -1249,7 +1249,7 @@ u16 getFreeServerActiveObjectId(
u16 ServerEnvironment::addActiveObject(ServerActiveObject *object)
{
assert(object);
- u16 id = addActiveObjectRaw(object, true);
+ u16 id = addActiveObjectRaw(object, true, 0);
return id;
}
@@ -1408,7 +1408,7 @@ ActiveObjectMessage ServerEnvironment::getActiveObjectMessage()
*/
u16 ServerEnvironment::addActiveObjectRaw(ServerActiveObject *object,
- bool set_changed)
+ bool set_changed, u32 dtime_s)
{
assert(object);
if(object->getId() == 0){
@@ -1448,7 +1448,7 @@ u16 ServerEnvironment::addActiveObjectRaw(ServerActiveObject *object,
// Register reference in scripting api (must be done before post-init)
scriptapi_add_object_reference(m_lua, object);
// Post-initialize object
- object->addedToEnvironment();
+ object->addedToEnvironment(dtime_s);
// Add static data to block
if(object->isStaticAllowed())
@@ -1585,7 +1585,7 @@ static void print_hexdump(std::ostream &o, const std::string &data)
/*
Convert stored objects from blocks near the players to active.
*/
-void ServerEnvironment::activateObjects(MapBlock *block)
+void ServerEnvironment::activateObjects(MapBlock *block, u32 dtime_s)
{
if(block==NULL)
return;
@@ -1609,7 +1609,7 @@ void ServerEnvironment::activateObjects(MapBlock *block)
"large amount of objects");
return;
}
- // A list for objects that couldn't be converted to static for some
+ // A list for objects that couldn't be converted to active for some
// reason. They will be stored back.
core::list<StaticObject> new_stored;
// Loop through stored static objects
@@ -1639,7 +1639,7 @@ void ServerEnvironment::activateObjects(MapBlock *block)
<<"activated static object pos="<<PP(s_obj.pos/BS)
<<" type="<<(int)s_obj.type<<std::endl;
// This will also add the object to the active static list
- addActiveObjectRaw(obj, false);
+ addActiveObjectRaw(obj, false, dtime_s);
}
// Clear stored list
block->m_static_objects.m_stored.clear();