Skip to content
Snippets Groups Projects
Commit 176378dc authored by JugadorXEI's avatar JugadorXEI
Browse files

Instawhip Recharge Mobj optimizations

parent 8326292a
Branches
Tags
No related merge requests found
...@@ -59,14 +59,11 @@ void Obj_InstaWhipThink (mobj_t *whip) ...@@ -59,14 +59,11 @@ void Obj_InstaWhipThink (mobj_t *whip)
void Obj_SpawnInstaWhipRecharge(player_t *player, angle_t angleOffset) void Obj_SpawnInstaWhipRecharge(player_t *player, angle_t angleOffset)
{ {
mobj_t *x = P_SpawnMobjFromMobj(player->mo, 0, 0, 0, MT_INSTAWHIP_RECHARGE); mobj_t *x = P_SpawnMobjFromMobj(player->mo, 0, 0, player->mo->height / 2, MT_INSTAWHIP_RECHARGE);
// This was previously used to delay the visual, back when this was VFX for a cooldown
// instead of VFX for a charge. We want to instantly bail out of that state now.
x->tics = 1;
x->renderflags |= RF_SLOPESPLAT | RF_NOSPLATBILLBOARD; x->renderflags |= RF_SLOPESPLAT | RF_NOSPLATBILLBOARD;
P_SetTarget(&recharge_target(x), player->mo); P_SetTarget(&recharge_target(x), player->mo);
P_InstaScale(x, x->target->scale * 2);
recharge_offset(x) = angleOffset; recharge_offset(x) = angleOffset;
} }
...@@ -81,7 +78,8 @@ void Obj_InstaWhipRechargeThink(mobj_t *x) ...@@ -81,7 +78,8 @@ void Obj_InstaWhipRechargeThink(mobj_t *x)
} }
P_MoveOrigin(x, target->x, target->y, target->z + (target->height / 2)); P_MoveOrigin(x, target->x, target->y, target->z + (target->height / 2));
P_InstaScale(x, 2 * target->scale); if (x->scale != target->scale * 2)
P_InstaScale(x, target->scale * 2);
x->angle = target->angle + recharge_offset(x); x->angle = target->angle + recharge_offset(x);
// Flickers every other frame // Flickers every other frame
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment