CookiePLMonster / SilentPatch

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

SA: Get rear van door position #93

Open B1ack-Wh1te opened 2 weeks ago

B1ack-Wh1te commented 2 weeks ago

CCarEnterExit::GetPositionToOpenCarDoor (0x64E77B + 6).

pHandling->AnimGroup is compared to ANIM_VEH_VAN (101), causing this condition to never be met. The reason is that pHandling->AnimGroup stores indexes for CVehicleAnimGroupData::m_vehicleAnimGroups. This index is calculated as follows: any animation group (for example, the same ANIM_VEH_VAN) is taken and ANIM_VEH_STD is subtracted from it. Hence, for the condition to work properly, you need a comparison with ANIM_VEH_VAN - ANIM_VEH_STD. This will be equal to 13.

CookiePLMonster commented 2 weeks ago

What gameplay consequences does this have?

B1ack-Wh1te commented 2 weeks ago

Members of the player's gang, when trying to sit on the back seats of the van, will not go to the center of the doors, but a little to the left/right of them, and then as if abruptly teleport to the center of the doors themselves. It's a little-noticed bug, but it's triggered by incorrect code, similar to that bug with headlights in foggy and rainy.

CookiePLMonster commented 2 weeks ago

I suspect III and VC may also be affected by this?

B1ack-Wh1te commented 2 weeks ago

I don't think so. There is a completely different code and there is no such field in handling.