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

Using setElementHealth on a dead ped makes it invincible #414

Closed
ArranTuna opened this issue Sep 5, 2018 · 3 comments · Fixed by #777 or #3507
Closed

Using setElementHealth on a dead ped makes it invincible #414

ArranTuna opened this issue Sep 5, 2018 · 3 comments · Fixed by #777 or #3507
Labels
bug Something isn't working sync
Milestone

Comments

@ArranTuna
Copy link
Collaborator

ArranTuna commented Sep 5, 2018

Describe the bug
The only way to respawn a ped is with setElementHealth, yet after calling setElementHealth on a dead ped, the server returns true for isPedDead. You can't damage the ped any more even though ped.health == 100.

To Reproduce

crun setElementPosition(localPlayer, 1968, -2033, 13)
srun a = createPed(0, 1967, -2025, 13)
-- Kill the ped
srun isPedDead(a) -- true
srun setElementHealth(a, 100)
srun isPedDead(a) -- true (should be false)
-- Shoot the ped, it won't take damage

Expected behaviour
@qaisjp said:

Setting the health of a ped to a health > 0 should respawn the ped.

Additional context
Do this after calling setElementHealth: setElementSyncer(a, true) and the ped will be able to take damage again, but onPedWasted isn't triggered.

From https://bugs.mtasa.com/view.php?id=8790

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

This comment has been minimized.

@patrikjuvonen patrikjuvonen modified the milestones: 1.5.7, Backlog Nov 3, 2018
@ghost ghost closed this as completed in #777 Apr 20, 2020
@patrikjuvonen patrikjuvonen removed their assignment Apr 20, 2020
@patrikjuvonen patrikjuvonen modified the milestones: Backlog, 1.5.8 Apr 20, 2020
qaisjp added a commit that referenced this issue Apr 23, 2020
Reopens #414

Reverts #777

This reverts commit e43d34f.
@qaisjp qaisjp modified the milestones: 1.5.8, Backlog Apr 23, 2020
@qaisjp qaisjp reopened this Apr 23, 2020
@Pirulax
Copy link
Contributor

Pirulax commented Nov 13, 2020

Dug true the sync logic a few days ago, and stumbled across this
Maybe it has something to do with this issue?

@Lpsd
Copy link
Member

Lpsd commented May 4, 2021

Has this now been resolved by 159d291 ?

Edit: that was the revert commit, duh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sync
Projects
None yet
5 participants