@@ -370,17 +370,21 @@ void RemoteClient::GetNextBlocks (
370
370
371
371
void RemoteClient::GotBlock (v3s16 p)
372
372
{
373
- if (m_blocks_sending.find (p) != m_blocks_sending.end ())
374
- m_blocks_sending.erase (p);
375
- else
376
- {
377
- m_excess_gotblocks++;
373
+ if (m_blocks_modified.find (p) == m_blocks_modified.end ()) {
374
+ if (m_blocks_sending.find (p) != m_blocks_sending.end ())
375
+ m_blocks_sending.erase (p);
376
+ else
377
+ m_excess_gotblocks++;
378
+
379
+ m_blocks_sent.insert (p);
378
380
}
379
- m_blocks_sent.insert (p);
380
381
}
381
382
382
383
void RemoteClient::SentBlock (v3s16 p)
383
384
{
385
+ if (m_blocks_modified.find (p) != m_blocks_modified.end ())
386
+ m_blocks_modified.erase (p);
387
+
384
388
if (m_blocks_sending.find (p) == m_blocks_sending.end ())
385
389
m_blocks_sending[p] = 0.0 ;
386
390
else
@@ -397,6 +401,7 @@ void RemoteClient::SetBlockNotSent(v3s16 p)
397
401
m_blocks_sending.erase (p);
398
402
if (m_blocks_sent.find (p) != m_blocks_sent.end ())
399
403
m_blocks_sent.erase (p);
404
+ m_blocks_modified.insert (p);
400
405
}
401
406
402
407
void RemoteClient::SetBlocksNotSent (std::map<v3s16, MapBlock*> &blocks)
@@ -409,6 +414,7 @@ void RemoteClient::SetBlocksNotSent(std::map<v3s16, MapBlock*> &blocks)
409
414
i != blocks.end (); ++i)
410
415
{
411
416
v3s16 p = i->first ;
417
+ m_blocks_modified.insert (p);
412
418
413
419
if (m_blocks_sending.find (p) != m_blocks_sending.end ())
414
420
m_blocks_sending.erase (p);
0 commit comments