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

Function SyncMonsterActive2

Source/sync.cpp:74–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74bool SyncMonsterActive2(TSyncMonster &monsterSync)
75{
76 int ndx = -1;
77 uint32_t lru = 0xFFFE;
78
79 for (size_t i = 0; i < ActiveMonsterCount; i++) {
80 if (sgnMonsters >= ActiveMonsterCount) {
81 sgnMonsters = 0;
82 }
83 int m = ActiveMonsters[sgnMonsters];
84 if (sgwLRU[m] < lru) {
85 lru = sgwLRU[m];
86 ndx = ActiveMonsters[sgnMonsters];
87 }
88 sgnMonsters++;
89 }
90
91 if (ndx == -1) {
92 return false;
93 }
94
95 SyncMonsterPos(monsterSync, ndx);
96 return true;
97}
98
99void SyncPlrInv(TSyncHeader *pHdr)
100{

Callers 1

sync_all_monstersFunction · 0.85

Calls 1

SyncMonsterPosFunction · 0.85

Tested by

no test coverage detected