Skip to content

Commit 786a68b

Browse files
committed
Improve task reset in warpPedIntoVehicle
1 parent 9e2b9ec commit 786a68b

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

Client/mods/deathmatch/logic/CClientPed.cpp

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,6 +1374,26 @@ void CClientPed::WarpIntoVehicle ( CClientVehicle* pVehicle, unsigned int uiSeat
13741374
SetSunbathing ( false );
13751375
KillAnimation ();
13761376

1377+
if ( m_pPlayerPed )
1378+
{
1379+
// Fall tasks
1380+
KillTask ( TASK_PRIORITY_EVENT_RESPONSE_TEMP );
1381+
// Swim tasks
1382+
KillTask ( TASK_PRIORITY_EVENT_RESPONSE_NONTEMP );
1383+
// Jump & vehicle enter/exit & custom animation tasks
1384+
KillTask ( TASK_PRIORITY_PRIMARY );
1385+
1386+
KillTaskSecondary ( TASK_SECONDARY_ATTACK );
1387+
1388+
// check we aren't in the fall and get up task
1389+
CTask * pTaskPhysicalResponse = m_pTaskManager->GetTask ( TASK_PRIORITY_PHYSICAL_RESPONSE );
1390+
// check our physical response task
1391+
if ( pTaskPhysicalResponse && strcmp ( pTaskPhysicalResponse->GetTaskName ( ), "TASK_COMPLEX_FALL_AND_GET_UP" ) == 0 )
1392+
{
1393+
m_pTaskManager->RemoveTask ( TASK_PRIORITY_PHYSICAL_RESPONSE );
1394+
}
1395+
}
1396+
13771397
// Eventually remove us from a previous vehicle
13781398
RemoveFromVehicle ();
13791399
//m_uiOccupyingSeat = uiSeat;
@@ -4057,17 +4077,6 @@ void CClientPed::InternalWarpIntoVehicle ( CVehicle* pGameVehicle )
40574077
{
40584078
if ( m_pPlayerPed )
40594079
{
4060-
// Reset whatever task
4061-
m_pTaskManager->RemoveTask ( TASK_PRIORITY_PRIMARY );
4062-
4063-
// check we aren't in the fall and get up task
4064-
CTask * pTaskPhysicalResponse = m_pTaskManager->GetTask ( TASK_PRIORITY_PHYSICAL_RESPONSE );
4065-
// check our physical response task
4066-
if ( pTaskPhysicalResponse && strcmp ( pTaskPhysicalResponse->GetTaskName ( ), "TASK_COMPLEX_FALL_AND_GET_UP" ) == 0 )
4067-
{
4068-
m_pTaskManager->RemoveTask ( TASK_PRIORITY_PHYSICAL_RESPONSE );
4069-
}
4070-
40714080
// Create a task to warp the player in and execute it
40724081
CTaskSimpleCarSetPedInAsDriver* pInTask = g_pGame->GetTasks ()->CreateTaskSimpleCarSetPedInAsDriver ( pGameVehicle );
40734082
if ( pInTask )

0 commit comments

Comments
 (0)