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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/thing_creature.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.

{
if (spconf->caster_affect_sound > 0)
thing_play_sample(castng, spconf->caster_affect_sound, NORMAL_PITCH, 0, 3, 0, 4, FULL_LOUDNESS);
Expand Down
Loading