mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[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:
parent
e34f136314
commit
9ad15e8da2
2 changed files with 3 additions and 10 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "9108"
|
||||
#define REVISION_NR "9109"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue