diff options
author | David Athay <ko2fan@gmail.com> | 2009-05-26 13:51:08 +0100 |
---|---|---|
committer | David Athay <ko2fan@gmail.com> | 2009-05-26 13:51:08 +0100 |
commit | 3c7c7df5572fb136a1c4f75c4ed558dd80f472d5 (patch) | |
tree | 747706e157c4a82b2aa370e48abd24b11a6eb267 /src | |
parent | 509d0a5cd64e37c5f6397ce20b4aef877b604e18 (diff) | |
download | manaserv-3c7c7df5572fb136a1c4f75c4ed558dd80f472d5.tar.gz manaserv-3c7c7df5572fb136a1c4f75c4ed558dd80f472d5.tar.bz2 manaserv-3c7c7df5572fb136a1c4f75c4ed558dd80f472d5.tar.xz manaserv-3c7c7df5572fb136a1c4f75c4ed558dd80f472d5.zip |
Fix target bugs.
Diffstat (limited to 'src')
-rw-r--r-- | src/defines.h | 2 | ||||
-rw-r--r-- | src/game-server/monster.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/defines.h b/src/defines.h index 19909b33..b256df20 100644 --- a/src/defines.h +++ b/src/defines.h @@ -149,7 +149,7 @@ enum { GPMSG_BEING_HEALTH_CHANGE = 0x0274, // W being id, W health GPMSG_BEINGS_MOVE = 0x0280, // { W being id, B flags [, C position, B speed] [, W*2 destination] }* GPMSG_ITEMS = 0x0281, // { W item id, W*2 position }* - PGMSG_ATTACK = 0x0290, // B direction + PGMSG_ATTACK = 0x0290, // W being id GPMSG_BEING_ATTACK = 0x0291, // W being id, B direction, B attacktype PGMSG_USE_SPECIAL = 0x0292, // B specialID PGMSG_SAY = 0x02A0, // S text diff --git a/src/game-server/monster.cpp b/src/game-server/monster.cpp index ed7048e2..d2267412 100644 --- a/src/game-server/monster.cpp +++ b/src/game-server/monster.cpp @@ -111,7 +111,7 @@ Monster::~Monster() void Monster::perform() { - if (mAction == ATTACK && mCurrentAttack) + if (mAction == ATTACK && mCurrentAttack && mTarget) { if (mAttackTime == mCurrentAttack->aftDelay) { @@ -160,7 +160,7 @@ void Monster::update() } // Check potential attack positions - Being *bestAttackTarget = NULL; + Being *bestAttackTarget = mTarget = NULL; int bestTargetPriority = 0; Point bestAttackPosition; Direction bestAttackDirection = DIRECTION_DOWN; |