From a3dba70c16c0ce4af1435ff2a35a86693ffd6198 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Thu, 11 Sep 2008 00:27:24 +0000 Subject: [PATCH] don't try to emit particles for grenades/knife git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2510 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/weapon.cpp | 4 ++++ source/src/weapon.h | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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; };