From 800d1665be853fa0787669c1721aa055b0565314 Mon Sep 17 00:00:00 2001 From: Cesar Canassa Date: Sat, 23 Jul 2022 01:03:04 +0200 Subject: [PATCH] :recycle: Remove monsterId from RandomWalk2 --- Source/monster.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/monster.cpp b/Source/monster.cpp index 6ddf08bf7..e719a5c7c 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -1785,10 +1785,8 @@ bool RandomWalk(Monster &monster, Direction md) return ok; } -bool RandomWalk2(int monsterId, Direction md) +bool RandomWalk2(Monster &monster, Direction md) { - auto &monster = Monsters[monsterId]; - Direction mdtemp = md; bool ok = DirOK(monster, md); // Can we continue in the same direction @@ -2802,7 +2800,7 @@ void SnakeAi(int monsterId) } if (!Walk(monster, md)) - RandomWalk2(monsterId, monster.direction); + RandomWalk2(monster, monster.direction); } else { AiDelay(monster, 15 - monster.intelligence + GenerateRnd(10)); }