- 0
using PlayerList c++
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
- 0 answers
- 2341 views
-
- 2 answers
- 2656 views
-
- 2 replies
- 1168 views
-
[C++] [TFS 1.X] Player (Mestre) Não Pode Atacar Seus Summons e Seus Summons Não Atacam Outros Players
By Yan Oliveira,
- 5 replies
- 1534 views
-
- 9 answers
- 3571 views
-

Question
nociam 90
Boa noite.
Estou com um problema de loop na minha lista e realmente não sei qual erro estou cometendo.
Faço o loop na lista se não tiver esse player na área ele exclui porem quanto tenho 2 player na área um deles sai dessa área o sistema entra em loop nesse trecho do código.
bool achou = false; for (Creature* creature : this->blockRespawList) { SpectatorHashSet listAux; g_game.map.getSpectators(listAux, this->position, false, true); for (Creature* creatureAux : listAux) { if (creatureAux == creature) { achou = true; } } if (!achou) { this->removeBlockRespawList(creature); this->setBlockRespaw(RESPAWN_NONE); } }removeBlockRespawList
auto it = std::find(blockRespawList.begin(), blockRespawList.end(), creature); if (it != blockRespawList.end()) { creature->decrementReferenceCounter(); blockRespawList.erase(it); }Resolvido pode fechar.
Edited by nociamLink to comment
https://xtibia.com/forum/topic/250046-using-playerlist-c/Share on other sites
0 answers to this question
Recommended Posts