#include "../command/common.qh"
#include "../mutators/all.qh"
#include "../round_handler.qh"
-#include "../t_items.qh"
-#include "../../common/animdecide.qh"
-#include "../../common/constants.qh"
-#include "../../common/monsters/all.qh"
-#include "../../common/notifications.qh"
-#include "../../common/util.qh"
-#include "../../common/weapons/all.qh"
-#include "../../lib/csqcmodel/sv_model.qh"
+#include <common/t_items.qh>
+#include <common/animdecide.qh>
+#include <common/constants.qh>
+#include <common/monsters/all.qh>
+#include <common/notifications.qh>
+#include <common/util.qh>
+#include <common/weapons/all.qh>
+#include <lib/csqcmodel/sv_model.qh>
.int state;
remove(this);
return;
}
- if (this.owner.deadflag != DEAD_NO)
+ if (IS_DEAD(self.owner))
{
// owner died; disappear
this.model = "";
remove(this);
return;
}
- if (this.owner.deadflag != DEAD_NO)
+ if (IS_DEAD(self.owner))
{
this.model = "";
return;
.float race_penalty;
bool weapon_prepareattack_check(Weapon thiswep, entity actor, .entity weaponentity, bool secondary, float attacktime)
{
+ if (actor.weaponentity == NULL) return true;
if (!weapon_prepareattack_checkammo(thiswep, actor, secondary)) return false;
// if sv_ready_restart_after_countdown is set, don't allow the player to shoot
void weapon_prepareattack_do(entity actor, .entity weaponentity, bool secondary, float attacktime)
{
entity this = actor.(weaponentity);
+ if (this == NULL) return;
this.state = WS_INUSE;
actor.spawnshieldtime = min(actor.spawnshieldtime, time); // kill spawn shield when you fire
.entity weaponentity, int fire) func)
{
entity this = actor.(weaponentity);
+ if (this == NULL) return;
bool restartanim;
if (fr == WFRAME_DONTCHANGE)
{
vector ou = v_up;
vector a = '0 0 0';
- if (this)
- {
- this.wframe = fr;
- if (fr == WFRAME_IDLE) a = this.anim_idle;
- else if (fr == WFRAME_FIRE1) a = this.anim_fire1;
- else if (fr == WFRAME_FIRE2) a = this.anim_fire2;
- else // if (fr == WFRAME_RELOAD)
- a = this.anim_reload;
- a.z *= g_weaponratefactor;
- }
+ this.wframe = fr;
+ if (fr == WFRAME_IDLE) a = this.anim_idle;
+ else if (fr == WFRAME_FIRE1) a = this.anim_fire1;
+ else if (fr == WFRAME_FIRE2) a = this.anim_fire2;
+ else // if (fr == WFRAME_RELOAD)
+ a = this.anim_reload;
+ a.z *= g_weaponratefactor;
v_forward = of;
v_right = or;
if (this)
{
- entity e;
- FOR_EACH_CLIENT(e) if (e == actor || (IS_SPEC(e) && e.enemy == actor)) wframe_send(e, this, a, restartanim);
+ FOREACH_CLIENT(true, LAMBDA(
+ if(it == actor || (IS_SPEC(it) && it.enemy == actor))
+ wframe_send(it, this, a, restartanim);
+ ));
}
if ((fr == WFRAME_FIRE1 || fr == WFRAME_FIRE2) && t)
if (time < game_starttime && !autocvar_sv_ready_restart_after_countdown) return true;
if (round_handler_IsActive() && !round_handler_IsRoundStarted()) return true;
if (player.player_blocked) return true;
- if (player.frozen) return true;
+ if (STAT(FROZEN, player)) return true;
if (player.weapon_blocked) return true;
return false;
}