-
Автор темы
- #1
when I turn on the spectator list and then drag the menu to the corner of the screen, my game crashes out of nowhere. I don't know how to solve this
Repost code spectator list(visuals.cpp)[QUOTE = "underrated, post: 1807033, member: 91346"]
use debug
[/ QUOTE]
in debug mode my game is crash
[QUOTE = "halabiba, post: 1807030, member: 414450"]
give me source
[/ QUOTE]
pass me ur dc
void Visuals::RenderSpectatorList() {
int specs = 0;
std::string spect = "";
if (g_EngineClient->IsInGame() && g_EngineClient->IsConnected()) {
int localIndex = g_EngineClient->GetLocalPlayer();
C_BasePlayer* pLocalEntity = C_BasePlayer::GetPlayerByIndex(localIndex);
if (pLocalEntity) {
for (int i = 0; i < g_EngineClient->GetMaxClients(); i++) {
C_BasePlayer* pBaseEntity = C_BasePlayer::GetPlayerByIndex(i);
if (!pBaseEntity) continue;
if (pBaseEntity->m_iHealth() > 0) continue;
if (pBaseEntity == pLocalEntity) continue;
if (pBaseEntity->IsDormant()) continue;
if (pBaseEntity->m_hObserverTarget() != pLocalEntity) continue;
player_info_t pInfo;
g_EngineClient->GetPlayerInfo(pBaseEntity->EntIndex(), &pInfo);
if (pInfo.ishltv) continue;
spect += pInfo.szName;
spect += "\n";
specs++;
}
}
}
ImGui::PushStyleVar(ImGuiStyleVar_WindowTitleAlign, ImVec2(0.5f, 0.5f));
if (ImGui::Begin("Spectator List", nullptr, ImVec2(0, 0), 0.4F, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar)) {
if (specs > 0) spect += "\n";
ImVec2 size = ImGui::CalcTextSize(spect.c_str());
ImGui::SetWindowSize(ImVec2(200, 25 + size.y));
ImGui::Text(spect.c_str());
}
ImGui::End();
ImGui::PopStyleVar();
}
where do u call it?keeps crashing
Проект предоставляет различный материал, относящийся к сфере киберспорта, программирования, ПО для игр, а также позволяет его участникам общаться на многие другие темы. Почта для жалоб: admin@yougame.biz