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

Fixed Teleport #3531

Merged
merged 1 commit into from
Oct 7, 2024
Merged

Fixed Teleport #3531

merged 1 commit into from
Oct 7, 2024

Conversation

AdamPlenty
Copy link
Contributor

Fixes #3530

@@ -1803,7 +1803,7 @@ void creature_cast_spell(struct Thing *castng, SpellKind spl_idx, long shot_lvl,
cctrl->teleport_y = trg_y;
}

if (spconf->caster_affected && castng->index == cctrl->targtng_idx)
if (spconf->caster_affected)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe Teleport should have its special case/check to not mess with others stuff?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a design choice we have to make. We need to set rules for setting the target parameter of the instance, i.e. the 3rd parameter of set_creature_instance().

I suggest that for teleport we set caster itself as the target parameter. It can imply that the spell teleport "caster itself" to somewhere. In the future, we could extend its function to allow it to teleport "another creature" to somewhere.

Copy link
Contributor

@Linvail Linvail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider setting caster's index to the 3rd parameter of set_creature_instanc() when using teleport spell.
I am not blocking this. I'm just providing alternative solution.

Loobinex

This comment was marked as resolved.

@Loobinex Loobinex merged commit 7debbdf into dkfans:master Oct 7, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Teleport spell is broken
4 participants