summaryrefslogtreecommitdiff
path: root/src/serverenvironment.h
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2018-03-09 08:25:48 +0100
committerLoïc Blot <nerzhul@users.noreply.github.com>2018-03-09 23:27:26 +0100
commit2c860a6a420e16289c56f6185f333a2dd0cde386 (patch)
treea7cf1cafcc95703480f1f475c775fe57a53d35f5 /src/serverenvironment.h
parentdef46c6cdb73c98b6bc73d5a4655b95e8442ce2f (diff)
downloadminetest-2c860a6a420e16289c56f6185f333a2dd0cde386.tar.gz
minetest-2c860a6a420e16289c56f6185f333a2dd0cde386.tar.bz2
minetest-2c860a6a420e16289c56f6185f333a2dd0cde386.zip
ServerEnvironment & StaticObject cleanups
* isFreeServerActiveObjectId is now part of ServerEnvironment * getFreeServerActiveObjectId is now part of ServerEnvironment * StaticObject constructor now take ServerActiveObject instead of type + string. This permits to remove a big string copy in some code parts
Diffstat (limited to 'src/serverenvironment.h')
-rw-r--r--src/serverenvironment.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/serverenvironment.h b/src/serverenvironment.h
index d51658330..ee5e8d857 100644
--- a/src/serverenvironment.h
+++ b/src/serverenvironment.h
@@ -257,6 +257,19 @@ public:
*/
u16 addActiveObject(ServerActiveObject *object);
+ /**
+ * Verify if id is a free active object id
+ * @param id
+ * @return true if slot is free
+ */
+ bool isFreeServerActiveObjectId(u16 id) const;
+
+ /**
+ * Retrieve the next free activeobject ID
+ * @return free activeobject ID or zero if not free ID found
+ */
+ u16 getFreeServerActiveObjectId();
+
/*
Add an active object as a static object to the corresponding
MapBlock.