diff --git a/.vscode/launch.json b/.vscode/launch.json index d594d94..34015be 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,10 +8,10 @@ "name": "Launch SA", "type": "cppvsdbg", "request": "launch", - "program": "C:/Work/GTASanAndreas/gta_sa.exe", + "program": "F:/GTASanAndreas/gta_sa.exe", "args": [], "stopAtEntry": false, - "cwd": "C:/Work/GTASanAndreas/", + "cwd": "F:/GTASanAndreas/", "environment": [], "console": "internalConsole" }, @@ -19,10 +19,10 @@ "name": "Launch VC", "type": "cppvsdbg", "request": "launch", - "program": "F:/GTA Vice City/gta-vc.exe", + "program": "E:/GTA Vice City/gta-vc.exe", "args": [], "stopAtEntry": false, - "cwd": "C:/Work/GTASanAndreas/", + "cwd": "F:/GTASanAndreas/", "environment": [], "console": "internalConsole" }, diff --git a/src/player.cpp b/src/player.cpp index ffd4579..7b01a94 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -300,7 +300,7 @@ void Player::ChangePlayerModel(std::string& model) CStreaming::LoadAllRequestedModels(true); player->SetModelIndex(291); - + CStreaming::SetSpecialCharIsDeletable(291); } else @@ -312,6 +312,7 @@ void Player::ChangePlayerModel(std::string& model) player->SetModelIndex(imodel); CStreaming::SetModelIsDeletable(imodel); } + Util::ClearCharTasksVehCheck(player); } } #elif GTAVC diff --git a/src/util.cpp b/src/util.cpp index 347ea4d..2ebc5e5 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -72,11 +72,13 @@ void Util::ClearCharTasksVehCheck(CPed* ped) uint hped = CPools::GetPedRef(ped); uint hveh = NULL; bool veh_engine = true; + float speed; if (ped->m_nPedFlags.bInVehicle) { hveh = CPools::GetVehicleRef(ped->m_pVehicle); veh_engine = ped->m_pVehicle->m_nVehicleFlags.bEngineOn; + speed = ped->m_pVehicle->m_vecMoveSpeed.Magnitude() * 50.0f; } Command(hped); @@ -85,6 +87,7 @@ void Util::ClearCharTasksVehCheck(CPed* ped) { Command(hped, hveh); ped->m_pVehicle->m_nVehicleFlags.bEngineOn = veh_engine; + Command(hveh, speed); } }