diff options
Diffstat (limited to 'src/game-server/trigger.cpp')
-rw-r--r-- | src/game-server/trigger.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/game-server/trigger.cpp b/src/game-server/trigger.cpp index f25b00b8..c4cec2f4 100644 --- a/src/game-server/trigger.cpp +++ b/src/game-server/trigger.cpp @@ -52,10 +52,15 @@ void TriggerArea::update() std::set<Actor*> insideNow; for (BeingIterator i(getMap()->getInsideRectangleIterator(mZone)); i; ++i) { - //skip garbage - if (!(*i) || (*i)->getPublicID() == 0) continue; + // Don't deal with unitialized actors. + if (!(*i) || !(*i)->isPublicIdValid()) + continue; - if (mZone.contains((*i)->getPosition())) //<-- Why is this additional condition necessary? Shouldn't getInsideRectangleIterator already exclude those outside of the zone? --Crush + // The BeingIterator returns the mapZones in touch with the rectangle + // area. On the other hand, the beings contained in the map zones + // may not be within the rectangle area. Hence, this additional + // contains() condition. + if (mZone.contains((*i)->getPosition())) { insideNow.insert(*i); |