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

Fix setPedOnFire(ped, false) doesn't cancel TASK_SIMPLE_PLAYER_ON_FIRE #3930

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

FileEX
Copy link
Contributor

@FileEX FileEX commented Jan 6, 2025

Fixed #3249

@TheNormalnij
Copy link
Member

TheNormalnij commented Jan 11, 2025

Why do you want to extend the setPedOnFire function instead of adding the new function removePedTask?
A new behavior is not intuitive. Your setPedOnFire(ped, false) does something with ped tasks ever if the ped has no fire effect.

Maybe im wrong here.
Does isElementOnFire return true before you call setPedOnFire(ped, false) when a ped has no fire effect?
Does the player lose health when TASK_SIMPLE_PLAYER_ON_FIRE is active?

@FileEX
Copy link
Contributor Author

FileEX commented Jan 11, 2025

Why do you want to extend the setPedOnFire function instead of adding the new function removePedTask?

We already have the killPedTask function.

A new behavior is not intuitive. Your setPedOnFire(ped, false) does something with ped tasks ever if the ped has no fire effect.

Yeah, it's a intentional because before using setPedOnFire, you can use extinguishFire, which means the player won't be on fire anymore, but the PLAYER_ON_FIRE task will remain active. That's why I changed the approach to return false if there's no fire.

Does isElementOnFire return true before you call setPedOnFire(ped, false) when a ped has no fire effect?

No

Does the player lose health when TASK_SIMPLE_PLAYER_ON_FIRE is active?

No, but as mentioned in the issue, it causes some problems with aiming.

I see that my proposed simple solution, which involves interrupting the PLAYER_ON_FIRE task after setting setPedOnFire to false (which is logical because if we don't want fire, we also don't want the task associated with it), is not well-received. I don't see the point in calling two separate functions:

setPedOnFire(ped, false) -- to extinguish the fire
killPedTask(ped, "secondary") -- to remove the PLAYER_ON_FIRE task

In my opinion, this approach doesn't make sense, because this action should be executed along with extinguishing the fire, not separately and manually by the scripter.

@TheNormalnij
Copy link
Member

Yeah, it's a intentional because before using setPedOnFire, you can use extinguishFire, which means the player won't be on fire anymore, but the PLAYER_ON_FIRE task will remain active. That's why I changed the approach to return false if there's no fire.

This is a problem. extinguishFire should disable the task or don't touch peds. A ped should not be able to get this bugged state when the ped isn't on fire but has active PLAYER_ON_FIRE task

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.

setPedOnFire(ped, false) doesn't cancel TASK_SIMPLE_PLAYER_ON_FIRE
2 participants