summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/control/Script.cpp3
-rw-r--r--src/peds/PedIK.cpp4
2 files changed, 3 insertions, 4 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 13000847..357436c6 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -5601,8 +5601,7 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
{
CollectParameters(&m_nIp, 1);
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
- assert(pVehicle);
- UpdateCompareFlag(pVehicle->bIsInWater);
+ UpdateCompareFlag(pVehicle && pVehicle->bIsInWater);
return 0;
}
case COMMAND_GET_CLOSEST_CHAR_NODE:
diff --git a/src/peds/PedIK.cpp b/src/peds/PedIK.cpp
index c9428cb3..ae9a85b4 100644
--- a/src/peds/PedIK.cpp
+++ b/src/peds/PedIK.cpp
@@ -64,8 +64,8 @@ CPedIK::RotateTorso(AnimBlendFrameData *node, LimbOrientation *limb, bool change
// We can't get the parent matrix of an hanim frame but
// this function is always called with PED_MID, so we know the parent frame.
// Trouble is that PED_MID is "Smid" on PS2/PC but BONE_torso on mobile/xbox...
- // so this doesn't exactly do what we'd like anyway
- RwMatrix *mat = GetComponentMatrix(m_ped, PED_MID);
+ // Assuming BONE_torso, the parent is BONE_mid, so let's use that:
+ RwMatrix *mat = GetBoneMatrix(m_ped, BONE_mid);
RwV3d vec1, vec2;
vec1.x = mat->right.z;