muzzle flashes on vweps

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2508 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2008-09-11 00:17:39 +00:00
parent 3c9f146511
commit 79f2de1d18
15 changed files with 140 additions and 7 deletions
+3 -1
View File
@@ -443,6 +443,8 @@ weapon::weapon(struct playerent *owner, int type) : type(type), owner(owner), in
const int weapon::weaponchangetime = 400;
const float weapon::weaponbeloweye = 0.2f;
int weapon::flashtime() const { return max((int)info.attackdelay, 120)/4; }
void weapon::sendshoot(vec &from, vec &to)
{
if(owner!=player1) return;
@@ -536,7 +538,7 @@ void weapon::renderhudmodel(int lastaction, int index)
if(!intermission) wm.calcmove(unitv, lastaction);
s_sprintfd(path)("weapons/%s", info.modelname);
static int lastanim[2], lastswitch[2];
bool emit = (wm.anim&ANIM_INDEX)==ANIM_GUN_SHOOT && (lastmillis - lastaction) < max((int)info.attackdelay, 120)/4;
bool emit = (wm.anim&ANIM_INDEX)==ANIM_GUN_SHOOT && (lastmillis - lastaction) < flashtime();
if(lastanim[index]!=(wm.anim|(type<<24)))
{
lastanim[index] = wm.anim|(type<<24);