fix(VehiclePreview): Issue w/ running fiber
This commit is contained in:
parent
b7db6b45dc
commit
dac6cf8cc6
@ -42,16 +42,11 @@ namespace big
|
||||
{
|
||||
if (m_running)
|
||||
return;
|
||||
|
||||
m_running = true;
|
||||
static bool busy = false;
|
||||
while (g_running && g->spawn.preview_vehicle && g_gui.m_opened)
|
||||
|
||||
g_fiber_pool->queue_job([this]
|
||||
{
|
||||
if (busy)
|
||||
continue;
|
||||
busy = true;
|
||||
|
||||
g_fiber_pool->queue_job([this]
|
||||
while (g_running && g->spawn.preview_vehicle && g_gui.m_opened)
|
||||
{
|
||||
auto location = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER::PLAYER_PED_ID(), 2.5f, 2.5f, .5f);
|
||||
if (m_current_veh == -1)
|
||||
@ -81,18 +76,13 @@ namespace big
|
||||
|
||||
if (m_heading += 0.5f; m_heading > 359) m_heading = 0;
|
||||
|
||||
busy = false;
|
||||
});
|
||||
}
|
||||
script::get_current()->yield();
|
||||
}
|
||||
|
||||
g_fiber_pool->queue_job([this]
|
||||
{
|
||||
entity::delete_entity(m_current_veh);
|
||||
|
||||
m_current_veh = -1;
|
||||
m_running = false;
|
||||
});
|
||||
|
||||
m_running = false;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user