From 9ad15e8da2dfe8933ad4ee3738a86bfe658f81b8 Mon Sep 17 00:00:00 2001 From: NoFantasy Date: Mon, 4 Jan 2010 02:26:46 +0100 Subject: [PATCH] [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 --- src/game/RandomMovementGenerator.cpp | 11 ++--------- src/shared/revision_nr.h | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/game/RandomMovementGenerator.cpp b/src/game/RandomMovementGenerator.cpp index 5965cfedf..8aeda7f2c 100644 --- a/src/game/RandomMovementGenerator.cpp +++ b/src/game/RandomMovementGenerator.cpp @@ -23,8 +23,6 @@ #include "Map.h" #include "Util.h" -#define RUNNING_CHANCE_RANDOMMV 20 //will be "1 / RUNNING_CHANCE_RANDOMMV" - template<> void RandomMovementGenerator::_setRandomLocation(Creature &creature) @@ -109,11 +107,8 @@ RandomMovementGenerator::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::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); } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index f85544fa3..c00d82fde 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9108" + #define REVISION_NR "9109" #endif // __REVISION_NR_H__