introduce extra melee attack for walking monsters to prevent 'kite'

This commit is contained in:
ErikasKontenis
2020-04-27 17:15:19 +03:00
parent e6fbf4a654
commit 24a3e9b18c
5 changed files with 69 additions and 4 deletions

View File

@@ -607,7 +607,12 @@ void Creature::onCreatureMove(Creature* creature, const Tile* newTile, const Pos
} else {
if (hasExtraSwing()) {
//our target is moving lets see if we can get in hit
g_dispatcher.addTask(createTask(std::bind(&Game::checkCreatureAttack, &g_game, getID())));
if (getMonster()) {
g_dispatcher.addTask(createTask(std::bind(&Game::checkMonsterExtraAttack, &g_game, getID())));
}
else {
g_dispatcher.addTask(createTask(std::bind(&Game::checkCreatureAttack, &g_game, getID())));
}
}
if (newTile->getZone() != oldTile->getZone()) {