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

[fixed] Bison's or vehicle's damage owner did not get unset when sitting player died #2038

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mugg91
Copy link
Contributor

@mugg91 mugg91 commented Apr 25, 2024

Status

  • READY: this PR is (to the best of your knowledge) ready to be incorporated into the game.

Description

[fixed] Bison's or vehicle's damage owner did not get unset when sitting player died

Fixes #2037

When playing online and dying while sitting on a catapult or a bison, the game correctly runs onDetach() in Seats.as.

However,

		print("detached is null ? " + (detached is null));
		print("detached player is null ? " + (detached.getPlayer() is null));
		print("detached tag dead ? " + (detached.hasTag("dead")));

will yield false, false, false on client and false, true, true on server.
Because the player was already null on server, the damage player didn't get unset.
To fix the issue, this PR adds a check if the detached blob has the tag "dead". When this condition is true we know the player must have died and we need to unset the damage owner.

Tested in online, works.

Steps to Test or Reproduce

Play CTF with bots in a server.
Spawn bison and tame it.
Spawn a bomb and place it in your inventory, then sit on the bison to die while sitting.
Notice how any kills the bison gets now will be attributed to you.
After this PR, kills are not attributed to you anymore.

@mugg91 mugg91 changed the title [fixed] Bison's or vehicle's damage owner will not get unset when sitting player dies [fixed] Bison's or vehicle's damage owner did not get unset when sitting player died Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in Seats.as
1 participant