dragon: fix dragon reviving after the dagger is pulled #1759
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #1572.
Checklist
Description
Fixed the dragon reviving itself after Lara removes the dagger in a 1 frame window.
Explanation:
Dragon_Collision:
item->frame_num - g_Anims[item->anim_num].frame_base <= DRAGON_ALMOST_LIVE // 100
Dragon_Control:
So what was happening simultaneously was:
Dragon_Control
runs andcreature->flags
increments to430
which is>= DRAGON_LIVE_TIME + DRAGON_ALMOST_LIVE
(330+100).Dragon_Collision
runs the same frame anditem->frame_num - g_Anims[item->anim_num].frame_base
is100
which is <=DRAGON_ALMOST_LIVE
(100) soM_PullDagger
runs .So,
M_PullDagger
runs, but that really only prepares the dragon for death by settingcreature->flags = -1;
. However, inDragon_Control
already, the hit points were reset to300/2
because thecreature->flags
hit430
. So, theelse... then if (dragon_front_item->hit_points <= 0) {
block is no longer run which checks forif (creature->flags > -20) {
when the dragon has no HP and kills the dragon.So, the fix is to change in
Dragon_Control
:if (creature->flags >= DRAGON_LIVE_TIME + DRAGON_ALMOST_LIVE) { // 330 + 100
to
if (creature->flags > DRAGON_LIVE_TIME + DRAGON_ALMOST_LIVE) { // 330 + 100
that way we don't lose 1 frame in the window to pull the dagger and kill the dragon. I cannot screenshot or capture video of the old DirectX SW rendered window for some reason.