From: Mario Date: Sat, 24 Dec 2016 05:09:44 +0000 (+1000) Subject: Merge branch 'master' into Mario/wepent_experimental X-Git-Tag: xonotic-v0.8.2~326^2~19 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=394ef402d22a2acd9e3990189f256f20dbcc4cba;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into Mario/wepent_experimental # Conflicts: # qcsrc/common/monsters/sv_monsters.qc --- 394ef402d22a2acd9e3990189f256f20dbcc4cba diff --cc qcsrc/common/monsters/sv_monsters.qc index a89e55b1c,f0f789af3..c7d5190e0 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@@ -412,18 -409,16 +409,18 @@@ bool Monster_Attack_Leap(entity this, v return true; } -void Monster_Attack_Check(entity this, entity targ) +void Monster_Attack_Check(entity this, entity targ, .entity weaponentity) { + int slot = weaponslot(weaponentity); + - if((this == NULL || targ == NULL) + if((!this || !targ) || (!this.monster_attackfunc) - || (time < this.attack_finished_single[0]) + || (time < this.attack_finished_single[slot]) ) { return; } if(vdist(targ.origin - this.origin, <=, this.attack_range)) { - bool attack_success = this.monster_attackfunc(MONSTER_ATTACK_MELEE, this, targ, weaponentity); - int attack_success = this.monster_attackfunc(MONSTER_ATTACK_MELEE, this, targ); ++ int attack_success = this.monster_attackfunc(MONSTER_ATTACK_MELEE, this, targ, weaponentity); if(attack_success == 1) Monster_Sound(this, monstersound_melee, 0, false, CH_VOICE); else if(attack_success > 0) @@@ -432,7 -427,7 +429,7 @@@ if(vdist(targ.origin - this.origin, >, this.attack_range)) { - float attack_success = this.monster_attackfunc(MONSTER_ATTACK_RANGED, this, targ, weaponentity); - int attack_success = this.monster_attackfunc(MONSTER_ATTACK_RANGED, this, targ); ++ int attack_success = this.monster_attackfunc(MONSTER_ATTACK_RANGED, this, targ, weaponentity); if(attack_success == 1) Monster_Sound(this, monstersound_melee, 0, false, CH_VOICE); else if(attack_success > 0)