Fix player stuck when chaning skin
This commit is contained in:
parent
53c75ab407
commit
196d154c79
8
.vscode/launch.json
vendored
8
.vscode/launch.json
vendored
@ -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"
|
||||
},
|
||||
|
@ -312,6 +312,7 @@ void Player::ChangePlayerModel(std::string& model)
|
||||
player->SetModelIndex(imodel);
|
||||
CStreaming::SetModelIsDeletable(imodel);
|
||||
}
|
||||
Util::ClearCharTasksVehCheck(player);
|
||||
}
|
||||
}
|
||||
#elif GTAVC
|
||||
|
@ -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<Commands::CLEAR_CHAR_TASKS_IMMEDIATELY>(hped);
|
||||
@ -85,6 +87,7 @@ void Util::ClearCharTasksVehCheck(CPed* ped)
|
||||
{
|
||||
Command<Commands::TASK_WARP_CHAR_INTO_CAR_AS_DRIVER>(hped, hveh);
|
||||
ped->m_pVehicle->m_nVehicleFlags.bEngineOn = veh_engine;
|
||||
Command<Commands::SET_CAR_FORWARD_SPEED>(hveh, speed);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user