MCPcopy Create free account
hub / github.com/diasurgical/devilution / sync_monster_active2

Function sync_monster_active2

Source/sync.cpp:105–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105BOOL sync_monster_active2(TSyncMonster *p)
106{
107 int i, m, ndx;
108 DWORD lru;
109
110 ndx = -1;
111 lru = 0xFFFE;
112
113 for (i = 0; i < nummonsters; i++) {
114 if (sgnMonsters >= nummonsters) {
115 sgnMonsters = 0;
116 }
117 m = monstactive[sgnMonsters];
118 if (sgwLRU[m] < lru) {
119 lru = sgwLRU[m];
120 ndx = monstactive[sgnMonsters];
121 }
122 sgnMonsters++;
123 }
124
125 if (ndx == -1) {
126 return FALSE;
127 }
128
129 sync_monster_pos(p, ndx);
130 return TRUE;
131}
132
133void SyncPlrInv(TSyncHeader *pHdr)
134{

Callers 1

sync_all_monstersFunction · 0.85

Calls 1

sync_monster_posFunction · 0.85

Tested by

no test coverage detected