CookiePLMonster / SilentPatch

SilentPatch for GTA III, Vice City, and San Andreas
MIT License
388 stars 15 forks source link

SA: Fix dinghy radio change anim #98

Open B1ack-Wh1te opened 2 weeks ago

B1ack-Wh1te commented 2 weeks ago

image Also, my fix corrects the feet falling under the car on cars like jester.

if (m_nVehicleFlags.bLowVehicle)
{
    for (auto& node : pAnimRadio->GetNodes())
    {
        if (!node.GetSequence()) {
            continue;
        }

        switch (node.GetSequence()->GetBoneTag())
        {
        case BONETAG_L_TOE:
        case BONETAG_L_THIGH:
        case BONETAG_L_CALF:
        case BONETAG_L_FOOT:
        case BONETAG_R_THIGH:
        case BONETAG_R_CALF:
        case BONETAG_R_FOOT:
        case BONETAG_R_TOE:
            node.SetSequence(nullptr);
            break;
        }
    }
}
else if (GetBaseVehicleType() == VEHICLE_TYPE_BOAT && !pHandling->mFlags.bSitInBoat)
{
    for (auto& node : pAnimRadio->GetNodes())
    {
        if (!node.GetSequence()) {
            continue;
        }

        switch (node.GetSequence()->GetBoneTag())
        {
        case BONETAG_L_TOE:
        case BONETAG_L_THIGH:
        case BONETAG_L_CALF:
        case BONETAG_L_FOOT:
        case BONETAG_R_THIGH:
        case BONETAG_R_CALF:
        case BONETAG_R_FOOT:
        case BONETAG_R_TOE:
        case BONETAG_ROOT:
        case BONETAG_PELVIS:
        case BONETAG_L_FOREARM:
        case BONETAG_L_UPPERARM:
        case BONETAG_L_HAND:
        case BONETAG_L_FINGERS:
        case BONETAG_L_FINGER01:
        case BONETAG_SPINE1:
        case BONETAG_SPINE:
            node.SetSequence(nullptr);
            break;
        }
    }
    pAnimRadio->ClearFlag(ABA_FLAG_ISPARTIAL);
}
CookiePLMonster commented 2 weeks ago

Where should this be done? Every time directly before playing the animation?

B1ack-Wh1te commented 2 weeks ago

CVehicle::ProcessDrivingAnims (0x6DF4F4). After calling this function. That is, when the animation is first created.