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 Hep ancestors sometimes spawning incorrectly #4245

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

Conversation

WizardIke
Copy link
Contributor

If the player gained enough piety to gain an ancestor on an enemy's turn or at the start of their turn (e.g. from an enemy digging or the player's passwal finishing), they will get a turn to act before their ancestor is summoned as the ancestor will be summoned at the end of the player's turn. Delaying the summoning of the ancestor to the end of the player's turn is done by storing a copy of the ancestor in a queue. This lead to a bug reported by krajj7 (aka chujev) where changing your ancestor's name on this turn would result in them spawning with the old name. Fix this by using the actual data for the ancestor instead of the data in the queue.

Queueing up spawning an ancestor also lead to a bug reported by NephilaWeaver where a teleport trap could teleport you into unexplored terrain giving you enough piety for an ancestor and then piety delay could bring you below the piety required for an ancestor but fail to remove your ancestor as it hadn't spawned yet. Then at the end of your next turn, your ancestor would spawn even though you didn't have enough piety. Then when your got enough piety for an ancestor, a second one would spawn. Fix this by checking if spawning an ancestor is needed before spawning one from the queue.

Fixes #3300
Fixes #3450

If the player gained enough piety to gain an ancestor on an enemy's turn
or at the start of their turn (e.g. from an enemy digging or the
player's passwal finishing), they will get a turn to act before their
ancestor is summoned as the ancestor will be summoned at the end of the
player's turn. Delaying the summoning of the ancestor to the end of the
player's turn is done by storing a copy of the ancestor in a queue.
This lead to a bug reported by krajj7 (aka chujev) where changing your
ancestor's name on this turn would result in them spawning with the old
name. Fix this by using the actual data for the ancestor instead of the
data in the queue.

Queueing up spawning an ancestor also lead to a bug reported by
NephilaWeaver where a teleport trap could teleport you into unexplored
terrain giving you enough piety for an ancestor and then piety delay
could bring you below the piety required for an ancestor but fail to
remove your ancestor as it hadn't spawned yet. Then at the end of your
next turn, your ancestor would spawn even though you didn't have enough
piety. Then when your got enough piety for an ancestor, a second one
would spawn. Fix this by checking if spawning an ancestor is needed
before spawning one from the queue.

Fixes crawl#3300
Fixes crawl#3450
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant