Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onVehicleDamage doesn't trigger for crashes that knock the player off a bike #383

Open
ArranTuna opened this issue Sep 3, 2018 · 6 comments
Labels
bug Something isn't working feedback Further information is requested
Milestone

Comments

@ArranTuna
Copy link
Collaborator

ArranTuna commented Sep 3, 2018

Describe the bug
onVehicleDamage doesn't trigger for crashes that knock the player off a bike

To Reproduce
Steps to reproduce the behavior:

  1. Enter this into runcode: srun addEventHandler("onVehicleDamage", getRootElement(), function(loss) outputChatBox(loss) end)
  2. Spawn a bike
  3. Scrape up against a few walls - you'll see it shows the loss every time
  4. Gain up speed and smash into a wall hard enough to fall off - doesn't show the loss

Expected behavior
The event should trigger.

Additional context
From https://bugs.mtasa.com/view.php?id=7679

@ArranTuna ArranTuna added the bug Something isn't working label Sep 3, 2018
@patrikjuvonen patrikjuvonen self-assigned this Sep 4, 2018
@patrikjuvonen patrikjuvonen added this to the 1.5.7 milestone Sep 4, 2018
@qaisjp

This comment has been minimized.

@qaisjp
Copy link
Contributor

qaisjp commented Sep 6, 2018

@sbx320 said:

Seems to be a GTA mechanic. Bikes don't seem to get damaged in a crash when the driver falls off.

@qaisjp
Copy link
Contributor

qaisjp commented Sep 6, 2018

In light of the above comment by sbx, what are your plans for this @patrikjuvonen?

@patrikjuvonen
Copy link
Contributor

First I'm going to test around and see what can be done. If bikes really do get absolutely no damage when ped is falling off then there's also no reason to call the event.

@patrikjuvonen patrikjuvonen modified the milestones: 1.5.7, Backlog Nov 3, 2018
@patrikjuvonen
Copy link
Contributor

patrikjuvonen commented Jan 1, 2019

For whatever reason I am not able to reproduce this problem in Multi Theft Auto v1.5.6-release-16191 or then I'm doing it wrong. I spawned a NRG-500 (also tried a few other motorcycles and bicycles), hit the wall a couple times, then smashed right into a wall and fell off (after having used setPedCanBeKnockedOffBike on myself), and it does show the loss, although it seems it's a tiny bit late maybe...?

@patrikjuvonen patrikjuvonen added the feedback Further information is requested label Jan 1, 2019
@Dutchman101
Copy link
Member

Dutchman101 commented Jan 1, 2019

For whatever reason I am not able to reproduce this problem in Multi Theft Auto v1.5.6-release-16191 or then I'm doing it wrong. I spawned a NRG-500 (also tried a few other motorcycles and bicycles), hit the wall a couple times, then smashed right into a wall and fell off (after having used setPedCanBeKnockedOffBike on myself), and it does show the loss, although it seems it's a tiny bit late maybe...?

It's possible that this damage is a result of the bike bouncing/scratching on the ground after you already fell off. If the impact is sufficient, it can go 'lead its own life' and get additional damage that is separated from the main impact damage which may not register. I recommend you to try multiple times, I will also try to reproduce it and update my reply.

Note: when working on this issue, it's a good idea to take into account this related issue (not transferred): Bike crashes cannot inflict fatal HP damage to players - if it's a GTA mechanic, it may aswell be the same sort of.

@patrikjuvonen patrikjuvonen removed their assignment Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feedback Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants