Ejemplo n.º 1
0
	void WorldInterface::UpdateBot(const bool& update_map)
	{
		while (!s_pBot)
		{
			// VM thread started before the game finished initialising.
			std::this_thread::sleep_for(std::chrono::milliseconds(100));
		}

		if (!s_pBotEntity)
		{
			unsigned int bot_id = s_pBot->my_id;
			for (auto& entity : s_pWorld->m_PlayerKeys)
			{
				std::shared_ptr<Player> player = std::dynamic_pointer_cast<Player>(s_pWorld->m_Entities[entity]);
				if (player->PlayerId() == bot_id)
				{
					s_pBotEntity = player;
					break;
				}
			}
		}

		s_pBot->x = (unsigned int)s_pBotEntity->Position().x;
		s_pBot->y = (unsigned int)s_pBotEntity->Position().y;

		if (s_pBot->x == s_CurrentTarget.x && s_pBot->y == s_CurrentTarget.y)
			s_pBot->current_path.erase(s_pBot->current_path.begin(), s_pBot->current_path.end());

		if (update_map)
			QueryMap();

		QueryBombs();
		QueryPlayers();
	}
Ejemplo n.º 2
0
		URI::QueryMap URI::queryMap(){
			return QueryMap(query);
		}