MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / SyncMonsterPos

Function SyncMonsterPos

Source/sync.cpp:38–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38void SyncMonsterPos(TSyncMonster &monsterSync, int ndx)
39{
40 auto &monster = Monsters[ndx];
41 monsterSync._mndx = ndx;
42 monsterSync._mx = monster.position.tile.x;
43 monsterSync._my = monster.position.tile.y;
44 monsterSync._menemy = encode_enemy(monster);
45 monsterSync._mdelta = sgnMonsterPriority[ndx] > 255 ? 255 : sgnMonsterPriority[ndx];
46 monsterSync.mWhoHit = monster.whoHit;
47 monsterSync._mhitpoints = SDL_SwapLE32(monster.hitPoints);
48
49 sgnMonsterPriority[ndx] = 0xFFFF;
50 sgwLRU[ndx] = monster.activeForTicks == 0 ? 0xFFFF : 0xFFFE;
51}
52
53bool SyncMonsterActive(TSyncMonster &monsterSync)
54{

Callers 2

SyncMonsterActiveFunction · 0.85
SyncMonsterActive2Function · 0.85

Calls 1

encode_enemyFunction · 0.85

Tested by

no test coverage detected