introduce new walking ticks when creature has to move but doesnt have anything to follow

This commit is contained in:
ErikasKontenis 2020-02-10 20:16:58 +02:00
parent 0cd1af211e
commit abed251a30
2 changed files with 8 additions and 1 deletions

View File

@ -54,7 +54,7 @@ timeBetweenExActions = 1000
-- Map -- Map
-- NOTE: set mapName WITHOUT .otbm at the end -- NOTE: set mapName WITHOUT .otbm at the end
mapName = "map" mapName = "mymap"
mapAuthor = "CipSoft" mapAuthor = "CipSoft"
-- MySQL -- MySQL

View File

@ -277,6 +277,13 @@ void Creature::addEventWalk(bool firstStep)
g_game.checkCreatureWalk(getID()); g_game.checkCreatureWalk(getID());
} }
if (const Monster* monster = getMonster()) {
Creature* creature = monster->getFollowCreature();
if (!creature) {
ticks = ticks * 1.25;
}
}
eventWalk = g_scheduler.addEvent(createSchedulerTask(ticks, std::bind(&Game::checkCreatureWalk, &g_game, getID()))); eventWalk = g_scheduler.addEvent(createSchedulerTask(ticks, std::bind(&Game::checkCreatureWalk, &g_game, getID())));
} }