diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-03-11 03:00:03 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-04-15 23:09:16 +0200 |
commit | f529913ebe287cdd33be5ddafd4a8452f41e9383 (patch) | |
tree | c8836cc9d1da91999d659b092ed9c3630bb3c34a /src/game-server/being.h | |
parent | 89944ee6755a8d1cf1afb8e1e4808529bccf04c6 (diff) | |
download | manaserv-f529913ebe287cdd33be5ddafd4a8452f41e9383.tar.gz manaserv-f529913ebe287cdd33be5ddafd4a8452f41e9383.tar.xz manaserv-f529913ebe287cdd33be5ddafd4a8452f41e9383.zip |
Fixed crash on first map update
The crash happened when it was trying to move an NPC from its old zone
to its new zone. The old zone was based on the old position, which was
(0,0). That crashed since its zone didn't match its old position, but
its new one.
This fix makes sure to update the old position to be in sync with the
zone, by resetting it after being inserted into the MapComposite.
Reviewed-by: Yohann Ferreira
Diffstat (limited to 'src/game-server/being.h')
-rw-r--r-- | src/game-server/being.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/game-server/being.h b/src/game-server/being.h index 35457bc..b210688 100644 --- a/src/game-server/being.h +++ b/src/game-server/being.h @@ -286,6 +286,10 @@ class Being : public Actor void setTarget(Being *target) { mTarget = target; } + /** + * Overridden in order to reset the old position upon insertion. + */ + virtual void inserted(); protected: static const int TICKS_PER_HP_REGENERATION = 100; |