From 2c860a6a420e16289c56f6185f333a2dd0cde386 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Fri, 9 Mar 2018 08:25:48 +0100 Subject: 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 --- src/serverenvironment.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/serverenvironment.h') 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. -- cgit v1.2.3