summaryrefslogtreecommitdiff
path: root/src/game-server/mapcomposite.h
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2013-09-19 19:59:58 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2013-09-19 19:59:58 +0200
commit810f968b177c332b4459ca08b7e9b010b209bea6 (patch)
tree3e0ffdf76711cfc538fe33c1fdb699de2a2b2a46 /src/game-server/mapcomposite.h
parentc168472002a465101e556a5165965de6bfb6231c (diff)
downloadmanaserv-810f968b177c332b4459ca08b7e9b010b209bea6.tar.gz
manaserv-810f968b177c332b4459ca08b7e9b010b209bea6.tar.bz2
manaserv-810f968b177c332b4459ca08b7e9b010b209bea6.tar.xz
manaserv-810f968b177c332b4459ca08b7e9b010b209bea6.zip
Some optimizations in GameHandler
The findActorNear, findBeingNear and findCharacterNear functions in gamehandler.cpp were iterating over nearby entities in search for an entity with a specific ID. Now they do a quick lookup of exactly that entity, and then check whether it is in range.
Diffstat (limited to 'src/game-server/mapcomposite.h')
-rw-r--r--src/game-server/mapcomposite.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/game-server/mapcomposite.h b/src/game-server/mapcomposite.h
index 464dfe7c..212d4529 100644
--- a/src/game-server/mapcomposite.h
+++ b/src/game-server/mapcomposite.h
@@ -182,6 +182,12 @@ class MapComposite
void remove(Entity *);
/**
+ * Returns the actor entity matching \a publicID, or null when no such
+ * entity exists.
+ */
+ Entity *findEntityById(int publicId) const;
+
+ /**
* Updates zones of every moving beings.
*/
void update();