Try
std::vector<DWORD>::iterator it;
it = std::find(bot.monsterQueue.begin(), bot.monsterQueue.end(), object);
if(it != bot.monsterQueue.end())
{
size_t idx = it - bot.monsterQueue.begin ()
bot.monsterDists.at(idx) = mobDist; // monsterDists is <int> vector
bot.monsterCoordX.at(idx) = PosX; // monsterCoordX is <int> vector
bot.monsterCoordY.at(idx) = PosY; // monsterCoordY is <int> vector too
}
It would also probably be better to create a structure with 4 members of the “monster”, monsterDist and X coordinates and Y coordinates and save struct objects in a vector.
source
share