[9109] Removing the option for run chance from generic random movement generator

Npcs with random movement in general do not behave like this, and movement that fits the pattern of a mixed movement run/walk must be made instead if needed.

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-01-04 02:26:46 +01:00
parent e34f136314
commit 9ad15e8da2
2 changed files with 3 additions and 10 deletions

View file

@ -23,8 +23,6 @@
#include "Map.h"
#include "Util.h"
#define RUNNING_CHANCE_RANDOMMV 20 //will be "1 / RUNNING_CHANCE_RANDOMMV"
template<>
void
RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature)
@ -109,11 +107,8 @@ RandomMovementGenerator<Creature>::Initialize(Creature &creature)
if (creature.canFly())
creature.AddMonsterMoveFlag(MONSTER_MOVE_FLY);
else if(irand(0,RUNNING_CHANCE_RANDOMMV) > 0)
creature.AddMonsterMoveFlag(MONSTER_MOVE_WALK);
else
creature.RemoveMonsterMoveFlag(MONSTER_MOVE_WALK); // run with 1/RUNNING_CHANCE_RANDOMMV chance
creature.AddMonsterMoveFlag(MONSTER_MOVE_WALK);
_setRandomLocation(creature);
}
@ -152,10 +147,8 @@ RandomMovementGenerator<Creature>::Update(Creature &creature, const uint32 &diff
{
if (creature.canFly())
creature.AddMonsterMoveFlag(MONSTER_MOVE_FLY);
else if(irand(0,RUNNING_CHANCE_RANDOMMV) > 0)
else
creature.AddMonsterMoveFlag(MONSTER_MOVE_WALK);
else // run with 1/RUNNING_CHANCE_RANDOMMV chance
creature.RemoveMonsterMoveFlag(MONSTER_MOVE_WALK);
_setRandomLocation(creature);
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9108"
#define REVISION_NR "9109"
#endif // __REVISION_NR_H__