sync monster mWhoHit and hitpoints

This commit is contained in:
qndel 2021-10-13 09:34:53 +02:00 committed by Anders Jenbo
commit b00feb4c3d
3 changed files with 13 additions and 1 deletions

View file

@ -41,6 +41,8 @@ void SyncMonsterPos(TSyncMonster &monsterSync, int ndx)
monsterSync._my = monster.position.tile.y;
monsterSync._menemy = encode_enemy(monster);
monsterSync._mdelta = sgnMonsterPriority[ndx] > 255 ? 255 : sgnMonsterPriority[ndx];
monsterSync.mWhoHit = monster.mWhoHit;
monsterSync._mhitpoints = monster._mhitpoints;
sgnMonsterPriority[ndx] = 0xFFFF;
sgwLRU[ndx] = monster._msquelch == 0 ? 0xFFFF : 0xFFFE;
@ -195,6 +197,8 @@ void SyncMonster(int pnum, const TSyncMonster &monsterSync)
}
decode_enemy(monster, enemyId);
monster.mWhoHit = monsterSync.mWhoHit;
monster._mhitpoints = monsterSync._mhitpoints;
}
bool IsEnemyIdValid(const Monster &monster, int enemyId)