MT-CTF / capturetheflag

Capture the Flag game using the Minetest Voxel Engine
https://ctf.rubenwardy.com
81 stars 88 forks source link

Drop the nade with illegal explode points if the thrower is dead #1201

Closed Emojigit closed 1 year ago

Emojigit commented 1 year ago

Fixes #1160

This PR add checks to player HP before adding nades back to thrower's inventory. If the player is head, the nade is dropped at its explode point.

This PR is ready for review.

farooqkz commented 1 year ago

Code LGTM and solves the problem. However, during testing, I discovered another bug :D https://github.com/MT-CTF/capturetheflag/issues/1203

farooqkz commented 1 year ago

Fixes #1160 Fixes #1203

This PR add checks to player HP before adding nades back to thrower's inventory. If the player is head, the nade is dropped at its explode point.

This PR is ready for review.

And if the player respawns before the nade lands, their HP is not zero and therefore the newly found bug(#1203) is not solved.

LoneWolfHT commented 1 year ago

That bug can be solved in a separate PR if Emojigit wants

Emojigit commented 1 year ago

That bug can be solved in a separate PR

The logic of solving #1203 may can also solve this problem, so they will be the same code. However, the fix isn't trivial, and I don't have a plan to work on it soon. This PR is able to merge, but the codes inside this PR may be replaced in the future.

LoneWolfHT commented 1 year ago

I'll leave this for now then

farooqkz commented 1 year ago

I'll leave this for now then

What do you mean?

That bug can be solved in a separate PR if Emojigit wants

Yeah no reason to make this PR wait.