diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-12-30 16:46:42 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-12-30 16:46:42 +0000 |
commit | 7a6bef223e5267eb377e39881de946251f7c7924 (patch) | |
tree | db55b9adcb0cbcb636219f325366debeaf582a6f /src/game-server/mapcomposite.cpp | |
parent | 7d23129b8f16dfa73e3842ac8e91c61e5a3393aa (diff) | |
download | manaserv-7a6bef223e5267eb377e39881de946251f7c7924.tar.gz manaserv-7a6bef223e5267eb377e39881de946251f7c7924.tar.bz2 manaserv-7a6bef223e5267eb377e39881de946251f7c7924.tar.xz manaserv-7a6bef223e5267eb377e39881de946251f7c7924.zip |
Removed reference-counted pointers from the game server.
Diffstat (limited to 'src/game-server/mapcomposite.cpp')
-rw-r--r-- | src/game-server/mapcomposite.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/game-server/mapcomposite.cpp b/src/game-server/mapcomposite.cpp index 1591ad9f..b877a775 100644 --- a/src/game-server/mapcomposite.cpp +++ b/src/game-server/mapcomposite.cpp @@ -396,15 +396,15 @@ ZoneIterator MapComposite::getAroundPlayerIterator(Player *obj, int radius) cons return ZoneIterator(r2, this); }
-bool MapComposite::insert(ObjectPtr obj) +bool MapComposite::insert(Object *obj) { Point const &pos = obj->getPosition(); - zones[(pos.x / zoneDiam) + (pos.y / zoneDiam) * mapWidth].insert(obj.get()); + zones[(pos.x / zoneDiam) + (pos.y / zoneDiam) * mapWidth].insert(obj); int type = obj->getType(); if (type == OBJECT_MONSTER || type == OBJECT_PLAYER || type == OBJECT_NPC) { - if (!allocate(static_cast< MovingObject * >(obj.get()))) + if (!allocate(static_cast< MovingObject * >(obj))) { return false; } @@ -414,21 +414,21 @@ bool MapComposite::insert(ObjectPtr obj) return true; } -void MapComposite::remove(ObjectPtr obj) +void MapComposite::remove(Object *obj) { Point const &pos = obj->getPosition(); - zones[(pos.x / zoneDiam) + (pos.y / zoneDiam) * mapWidth].remove(obj.get()); + zones[(pos.x / zoneDiam) + (pos.y / zoneDiam) * mapWidth].remove(obj); int type = obj->getType(); if (type == OBJECT_MONSTER || type == OBJECT_PLAYER || type == OBJECT_NPC) { - deallocate(static_cast< MovingObject * >(obj.get())); + deallocate(static_cast< MovingObject * >(obj)); } for (Objects::iterator o = objects.begin(), o_end = objects.end(); o != o_end; ++o) { - if (o->get() == obj.get()) + if (*o == obj) { *o = *(o_end - 1); objects.pop_back(); @@ -454,7 +454,7 @@ void MapComposite::update() { continue; } - MovingObject *obj = static_cast< MovingObject * >(o->get()); + MovingObject *obj = static_cast< MovingObject * >(*o); Point const &pos1 = obj->getOldPosition(), &pos2 = obj->getPosition(); |