Browse Source

Sync monster light when position is gotten from the network

pull/6181/head
Anders Jenbo 3 years ago
parent
commit
67ea5bcbe6
  1. 2
      Source/msg.cpp
  2. 3
      Source/sync.cpp

2
Source/msg.cpp

@ -2635,6 +2635,8 @@ void DeltaLoadLevel()
monster.position.tile = position;
monster.position.old = position;
monster.position.future = position;
if (monster.lightId != NO_LIGHT)
ChangeLightXY(monster.lightId, position);
}
if (deltaLevel.monster[i].hitPoints != -1) {
monster.hitPoints = deltaLevel.monster[i].hitPoints;

3
Source/sync.cpp

@ -7,6 +7,7 @@
#include <cstdint>
#include "levels/gendung.h"
#include "lighting.h"
#include "monster.h"
#include "player.h"
@ -191,6 +192,8 @@ void SyncMonster(bool isOwner, const TSyncMonster &monsterSync)
M_ClearSquares(monster);
dMonster[position.x][position.y] = monsterId + 1;
monster.position.tile = position;
if (monster.lightId != NO_LIGHT)
ChangeLightXY(monster.lightId, position);
decode_enemy(monster, enemyId);
Direction md = GetDirection(position, monster.enemyPosition);
M_StartStand(monster, md);

Loading…
Cancel
Save