}
a.z *= wrate;
- //LOG_INFO(vtos(a), " ", ftos(fr), " ", ftos(wrate), "\n");
-
if(fr == WFRAME_IDLE) // we don't need to enforce idle animation
wepent.animstate_looping = false;
else
int slot = weaponslot(weaponentity);
ATTACK_FINISHED(actor, slot) = time + WEP_CVAR_PRI(hagar, refire) * W_WeaponRateFactor(actor);
- int theframe = WFRAME_FIRE1;
- entity this = actor.(weaponentity);
- if(this)
- {
- if(this.wframe == WFRAME_FIRE1)
- theframe = WFRAME_DONTCHANGE;
- }
- weapon_thinkf(actor, weaponentity, theframe, WEP_CVAR_PRI(hagar, refire), W_Hagar_Attack_Auto);
+ weapon_thinkf_ex(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(hagar, refire), W_Hagar_Attack_Auto, true);
}
METHOD(Hagar, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
* @param t defer thinking until time + t
* @param func next think function
*/
-void weapon_thinkf(entity actor, .entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,
- .entity weaponentity, int fire) func)
+void weapon_thinkf_ex(entity actor, .entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,
+ .entity weaponentity, int fire) func, bool forcenorestart)
{
entity this = actor.(weaponentity);
if (this == NULL) return;
restartanim = fr != WFRAME_IDLE;
}
+ if(forcenorestart)
+ restartanim = false;
+
vector of = v_forward;
vector or = v_right;
vector ou = v_up;
+ this.wframe = fr;
+
v_forward = of;
v_right = or;
v_up = ou;
actor.anim_upper_action = 0;
}
}
+void weapon_thinkf(entity actor, .entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,
+ .entity weaponentity, int fire) func)
+{
+ weapon_thinkf_ex(actor, weaponentity, fr, t, func, false);
+}
+
bool forbidWeaponUse(entity player)
{
void weapon_prepareattack_do(entity actor, .entity weaponentity, float secondary, float attacktime);
+void weapon_thinkf_ex(entity actor, .entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor, .entity weaponentity, int fire) func, bool forcenorestart);
+
void weapon_thinkf(entity actor, .entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor, .entity weaponentity, int fire) func);