projectile: fix .prevpos being set incorrectly
This broke collision lerping, and automatic angle calculation in cases where position is influenced by external tasks. A stage 2 pattern seems to have relied on this broken behavior, and was also fixed.
This commit is contained in:
parent
070768863f
commit
bc1267f0e8
2 changed files with 9 additions and 2 deletions
|
@ -549,7 +549,6 @@ void process_projectiles(ProjectileList *projlist, bool collision) {
|
|||
|
||||
for(Projectile *proj = projlist->first, *next; proj; proj = next) {
|
||||
next = proj->next;
|
||||
proj->prevpos = proj->pos;
|
||||
|
||||
if(proj->flags & PFLAG_INTERNAL_DEAD) {
|
||||
delete_projectile(projlist, proj, NULL);
|
||||
|
@ -588,6 +587,7 @@ void process_projectiles(ProjectileList *projlist, bool collision) {
|
|||
}
|
||||
}
|
||||
|
||||
proj->prevpos = proj->pos;
|
||||
apply_projectile_collision(projlist, proj, &col);
|
||||
}
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ TASK(spinshot_fairy_attack_spawn_projs, {
|
|||
.pos = o,
|
||||
.move = move_from_towards(o, o + ofs, 0.1),
|
||||
.max_viewport_dist = 128,
|
||||
.flags = PFLAG_MANUALANGLE,
|
||||
));
|
||||
|
||||
ofs *= r;
|
||||
|
@ -96,7 +97,12 @@ TASK(spinshot_fairy_attack, {
|
|||
cmplx ofs = ref_pos - proj_origins[i];
|
||||
proj_origins[i] += ofs;
|
||||
p->pos += ofs;
|
||||
p->move.attraction_point += ofs;
|
||||
p->move.attraction_point += ofs;
|
||||
|
||||
if(p->move.velocity) {
|
||||
p->angle = carg(p->move.velocity);
|
||||
}
|
||||
|
||||
++live_count;
|
||||
});
|
||||
|
||||
|
@ -116,6 +122,7 @@ TASK(spinshot_fairy_attack, {
|
|||
cmplx dir = cdir(p->angle);
|
||||
p->move = move_accelerated(dir * ARGS.activated_vel_multiplier, dir * ARGS.activated_accel_multiplier);
|
||||
p->move.retention *= ARGS.activated_retention_multiplier;
|
||||
p->flags &= ~PFLAG_MANUALANGLE;
|
||||
++live_count;
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue