fix gunfire rates vs. fps
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4339 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -312,7 +312,7 @@ void hit(int damage, playerent *d, playerent *at, const vec &vel, int gun, bool
|
||||
{
|
||||
if(d==player1 || d->type==ENT_BOT || !m_mp(gamemode)) d->hitpush(damage, vel, at, gun);
|
||||
|
||||
if(at==player1 && d!=player1)
|
||||
if(at==player1 && d!=player1)
|
||||
{
|
||||
extern int hitsound;
|
||||
extern int lasthit;
|
||||
@@ -933,7 +933,9 @@ gun::gun(playerent *owner, int type) : weapon(owner, type) {}
|
||||
bool gun::attack(vec &targ)
|
||||
{
|
||||
int attackmillis = lastmillis-owner->lastaction;
|
||||
if(timebalance < gunwait) attackmillis += timebalance;
|
||||
if(attackmillis<gunwait) return false;
|
||||
timebalance = gunwait ? attackmillis - gunwait : 0;
|
||||
gunwait = reloading = 0;
|
||||
|
||||
if(!owner->attacking)
|
||||
|
||||
+5
-5
@@ -17,14 +17,14 @@ struct weapon
|
||||
int &ammo, &mag, &gunwait, shots;
|
||||
virtual int dynspread();
|
||||
virtual float dynrecoil();
|
||||
int reloading, lastaction;
|
||||
int reloading, lastaction, timebalance;
|
||||
|
||||
virtual bool attack(vec &targ) = 0;
|
||||
virtual void attackfx(const vec &from, const vec &to, int millis) = 0;
|
||||
virtual void attackphysics(vec &from, vec &to);
|
||||
virtual void attacksound();
|
||||
virtual bool reload();
|
||||
virtual void reset() {}
|
||||
virtual void reset() { timebalance = 0; }
|
||||
virtual bool busy() { return false; }
|
||||
|
||||
virtual int modelanim() = 0;
|
||||
@@ -34,7 +34,7 @@ struct weapon
|
||||
virtual void renderstats();
|
||||
virtual void renderhudmodel();
|
||||
virtual void renderaimhelp(bool teamwarning);
|
||||
|
||||
|
||||
virtual void onselecting();
|
||||
virtual void ondeselecting() {}
|
||||
virtual void onammopicked() {}
|
||||
@@ -146,7 +146,7 @@ struct pistol : gun
|
||||
struct akimbo : gun
|
||||
{
|
||||
akimbo(playerent *owner);
|
||||
|
||||
|
||||
bool akimboside;
|
||||
int akimbomillis;
|
||||
int akimbolastaction[2];
|
||||
@@ -172,7 +172,7 @@ struct knife : weapon
|
||||
void drawstats();
|
||||
void attackfx(const vec &from, const vec &to, int millis);
|
||||
void renderstats();
|
||||
|
||||
|
||||
int flashtime() const;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user