Browse Source

Make TalktoMonster multiplayer compatible

pull/5527/head
obligaron 3 years ago committed by Anders Jenbo
parent
commit
d2d96f988c
  1. 3
      Source/monster.cpp
  2. 2
      Source/monster.h
  3. 6
      Source/player.cpp

3
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;

2
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);

6
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);
}

Loading…
Cancel
Save