storm345dev / ucars

The repo of ucars(bukkit)
10 stars 9 forks source link

Fix deaths registering twice when inside of a car #2

Closed CullanP closed 9 years ago

CullanP commented 9 years ago

This is a fix for deaths registering twice whilst dying inside of a car by someone else. If someone killed you with a sword and you were riding in a car it will show 2 deaths rather then one. Not sure why, but I assume it has to do with using damageable and damaging the player. This might not be an issue on 1.7, but tested on 1.8.3 as an issue.

storm345 commented 9 years ago

I am not able to reproduce your issue and indeed your code shouldn't change functionality of the plugin at all. Have you tested that the suggested tweak still prevents fall damage in cars and that it indeed fixes your issue? If so I may pull it anyway, but the issue is more likely another plugin conflicting, not a fault of uCars.

CullanP commented 9 years ago

Fall damage is still negated. I'm on a spigot 1.8.3 build and if someone is inside of a car and I kill them it will register their death twice (Can be annoying for certain plugins). All my check does is check if the damage is fall and if not just return. It shouldn't really need to check any other damage since the method is only used for fall damage.

storm345 commented 9 years ago

Yes I understand that, but does your code fix the double-death-event bug?

CullanP commented 9 years ago

Yes. That's why I made this pull request. I know gtamc (another server) has the same issue with car deaths registering twice so I figured I might as well. Idk why you're hesitant of accepting this, this will make the event run only when it's needed to run anyways