diff --git a/Source/monster.cpp b/Source/monster.cpp index 76b87b638..0e3ab430d 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -4473,9 +4473,8 @@ Monster *PreSpawnSkeleton() return skeleton; } -void TalktoMonster(Monster &monster) +void TalktoMonster(Player &player, Monster &monster) { - Player &player = Players[monster.enemy]; monster.mode = MonsterMode::Talk; if (monster.ai != AI_SNOTSPIL && monster.ai != AI_LACHDAN) { return; diff --git a/Source/monster.h b/Source/monster.h index 0d7ce3bb5..a625af154 100644 --- a/Source/monster.h +++ b/Source/monster.h @@ -504,7 +504,7 @@ bool IsGoat(_monster_id mt); */ void ActivateSkeleton(Monster &monster, Point position); Monster *PreSpawnSkeleton(); -void TalktoMonster(Monster &monster); +void TalktoMonster(Player &player, Monster &monster); void SpawnGolem(Player &player, Monster &golem, Point position, Missile &missile); bool CanTalkToMonst(const Monster &monster); int encode_enemy(Monster &monster); diff --git a/Source/player.cpp b/Source/player.cpp index c56959ec4..9db11a09f 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -1362,7 +1362,7 @@ void CheckNewPath(Player &player, bool pmWillBeCalled) if (x < 2 && y < 2) { ClrPlrPath(player); if (player.destAction == ACTION_ATTACKMON && monster->talkMsg != TEXT_NONE && monster->talkMsg != TEXT_VILE14) { - TalktoMonster(*monster); + TalktoMonster(player, *monster); } else { StartAttack(player, d); } @@ -1428,7 +1428,7 @@ void CheckNewPath(Player &player, bool pmWillBeCalled) if (x <= 1 && y <= 1) { d = GetDirection(player.position.future, monster->position.future); if (monster->talkMsg != TEXT_NONE && monster->talkMsg != TEXT_VILE14) { - TalktoMonster(*monster); + TalktoMonster(player, *monster); } else { StartAttack(player, d); } @@ -1449,7 +1449,7 @@ void CheckNewPath(Player &player, bool pmWillBeCalled) case ACTION_RATTACKMON: d = GetDirection(player.position.future, monster->position.future); if (monster->talkMsg != TEXT_NONE && monster->talkMsg != TEXT_VILE14) { - TalktoMonster(*monster); + TalktoMonster(player, *monster); } else { StartRangeAttack(player, d, monster->position.future.x, monster->position.future.y); }