mtasa-blue icon indicating copy to clipboard operation
mtasa-blue copied to clipboard

Workaround fix for "Climbing over certain objects kills you, when you have high FPS" (#602)

Open lopezloo opened this issue 3 years ago • 12 comments

This PR introduces workaround fix for "Climbing over certain objects kills you, when you have high FPS" (#602). It's basically the same fix as script fix for this issue but done in mtasa-blue instead. We basically cancel ped damage in certain case, when:

  • there is no attacker
  • damage type is fall
  • hit zone is torso
  • ped has jump task
  • ped has climb task

(in script version of this fix there is also check for TASK_COMPLEX_IN_AIR_AND_LAND task but it's redudant and makes it actually not working in some cases)

(damage sound is still being played)

lopezloo avatar Jul 03 '22 21:07 lopezloo

Crash on server connection

Version = 1.5.9-custom.0.000
Time = Mon Jul  4 19:48:44 2022
Module = D:\Rockstar Games\GTA San Andreas\gta_sa.exe
Code = 0xC0000005
Offset = 0x001B5209

EAX=21A54830  EBX=00000000  ECX=00000000  EDX=00000092  ESI=00000C90
EDI=00000000  EBP=008E2CB0  ESP=0177FD08  EIP=005B5209  FLG=00210297
CS=0023   DS=002B  SS=002B  ES=002B   FS=0053  GS=002B

PlatinMTA avatar Jul 04 '22 22:07 PlatinMTA

Wouldn't it be more advisable to fix the source of the damage, rather than applying a workaround?

sbx320 avatar Jul 09 '22 07:07 sbx320

Wouldn't it be more advisable to fix the source of the damage, rather than applying a workaround?

I don't know what is the cause of this bug. It's looped fall damage happening during climb task. I think it happens because ped both touches the ground (like it would fall off) and starts climbing at near same time. Maybe climb task overrides the fall off task and then game tries to initiate the fall off task again forever? But even if that's the cause - how to exactly patch this in SA?

lopezloo avatar Jul 09 '22 09:07 lopezloo

Doesn't SilentPatch fix this? I'm not completely sure it does.

PlatinMTA avatar Jul 09 '22 13:07 PlatinMTA

Doesn't SilentPatch fix this? I'm not completely sure it does.

I don't think so. There are no framerate related fixes in SilentPatch AFAIK. And this issue is quite minor by the way.

lopezloo avatar Jul 09 '22 19:07 lopezloo

Crash on server connection

Version = 1.5.9-custom.0.000
Time = Mon Jul  4 19:48:44 2022
Module = D:\Rockstar Games\GTA San Andreas\gta_sa.exe
Code = 0xC0000005
Offset = 0x001B5209

EAX=21A54830  EBX=00000000  ECX=00000000  EDX=00000092  ESI=00000C90
EDI=00000000  EBP=008E2CB0  ESP=0177FD08  EIP=005B5209  FLG=00210297
CS=0023   DS=002B  SS=002B  ES=002B   FS=0053  GS=002B

Just noticed, I had the same crash with #directx11 and #2663, so it's probably on my end (always using the artifacts, and the crash comes after joining a server). I don't crash on nightlies or normal versions.

PlatinMTA avatar Jul 11 '22 01:07 PlatinMTA

This bug could be possibly fixed by patching this in SA: https://github.com/codenulls/gta-reversed/blob/3cfeabd54aa9cefab3b8770aaec730d19b579e55/source/game_sa/Tasks/TaskTypes/CTaskSimpleClimb.cpp#L189 https://github.com/codenulls/gta-reversed/blob/3cfeabd54aa9cefab3b8770aaec730d19b579e55/source/game_sa/Tasks/TaskTypes/CTaskSimpleClimb.cpp#L210

Canceling this damage in MTA seems to be working well though.

lopezloo avatar Jul 12 '22 00:07 lopezloo

Closing in favor of #2667.

lopezloo avatar Jul 12 '22 04:07 lopezloo

#2667 doesn't work for one particular position. I'm reopening this.

lopezloo avatar Jul 13 '22 08:07 lopezloo

Can we get this merged? We have uncapped the fps for almost a year now and this issue stills bothers users with high fps.

PlatinMTA avatar Jul 27 '23 01:07 PlatinMTA

@PlatinMTA before it happens you can use Lua version of it i guess? It doesn't really touch the default damage, unless some circumstances are met. Either the one from here or example from wiki

sacr1ficez avatar Jul 27 '23 04:07 sacr1ficez

@PlatinMTA before it happens you can use Lua version of it i guess? It doesn't really touch the default damage, unless some circumstances are met. Either the one from here or example from wiki

That one works, this one doesn't https://github.com/multitheftauto/mtasa-blue/issues/602#issuecomment-1167673919

Thank you srsly

PlatinMTA avatar Jul 27 '23 07:07 PlatinMTA