diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 63d107a2..c40580ee 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -692,6 +692,8 @@ void grenadeent::onmoved(const vec &dist) grenades::grenades(playerent *owner) : weapon(owner, GUN_GRENADE), inhandnade(NULL), throwwait((13*1000)/40), throwmillis(0), state(GST_NONE) {} +int grenades::flashtime() const { return 0; } + bool grenades::busy() { return state!=GST_NONE; } bool grenades::attack(vec &targ) @@ -1008,6 +1010,8 @@ bool akimbo::timerout() { return akimbomillis && akimbomillis <= lastmillis; } knife::knife(playerent *owner) : weapon(owner, GUN_KNIFE) {} +int knife::flashtime() const { return 0; } + bool knife::attack(vec &targ) { int attackmillis = lastmillis-owner->lastaction; diff --git a/source/src/weapon.h b/source/src/weapon.h index 96490df8..0c4fdb09 100644 --- a/source/src/weapon.h +++ b/source/src/weapon.h @@ -45,7 +45,7 @@ struct weapon static bool valid(int id); - int flashtime() const; + virtual int flashtime() const; }; struct grenadeent; @@ -74,6 +74,7 @@ struct grenades : weapon bool busy(); void onselecting(); void onownerdies(); + int flashtime() const; }; @@ -168,5 +169,7 @@ struct knife : weapon void drawstats(); void attackfx(const vec &from, const vec &to, int millis); void renderstats(); + + int flashtime() const; };