}
-bool CL_Weaponentity_CustomizeEntityForClient(entity this)
+bool CL_Weaponentity_CustomizeEntityForClient(entity this, entity client)
{
this.viewmodelforclient = this.owner;
- if (IS_SPEC(other) && other.enemy == this.owner) this.viewmodelforclient = other;
+ if (IS_SPEC(client) && client.enemy == this.owner) this.viewmodelforclient = client;
return true;
}
if (ammo) return true;
// always keep the Mine Layer if we placed mines, so that we can detonate them
if (thiswep == WEP_MINE_LAYER)
- for (entity mine; (mine = find(mine, classname, "mine")); )
- if (mine.owner == actor) return false;
+ {
+ FOREACH_ENTITY_ENT(owner, actor,
+ {
+ if(it.classname != "mine") continue;
+ if(it.owner == actor) return false;
+ });
+ }
if (thiswep == WEP_SHOTGUN)
if (!secondary && WEP_CVAR(shotgun, secondary) == 1) return false; // no clicking, just allow
if ((fr == WFRAME_FIRE1 || fr == WFRAME_FIRE2) && t)
{
- int act = (fr == WFRAME_FIRE2 && (PS(actor).m_weapon == WEP_SHOCKWAVE || PS(actor).m_weapon == WEP_SHOTGUN))
+ bool primary_melee = boolean(fr == WFRAME_FIRE1 && (PS(actor).m_weapon.spawnflags & WEP_TYPE_MELEE_PRI));
+ bool secondary_melee = boolean(fr == WFRAME_FIRE2 && (PS(actor).m_weapon.spawnflags & WEP_TYPE_MELEE_SEC));
+ int act = (primary_melee || secondary_melee)
? ANIMACTION_MELEE
: ANIMACTION_SHOOT
;
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 (gameover) return true;
if (STAT(FROZEN, player)) return true;
if (player.weapon_blocked) return true;
return false;
{
Weapon w = Weapons_from(weapon_type);
weapon_dropevent_item = weapon_item;
- WITHSELF(player, w.event(w, player));
+ w.event(w, player);
}