more scope/unscope information

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5285 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
flowtron
2010-07-05 18:40:17 +00:00
parent fd07a2be14
commit df56df55ea
2 changed files with 13 additions and 4 deletions
+9
View File
@@ -114,6 +114,15 @@ void processevent(client *c, reloadevent &e)
gs.ammo[e.gun] -= numbullets;
int wait = e.millis - gs.lastshot;
/*
// actually the clients sends this by itself, but sanity checks should be made!!
// does this state get reset on spawn etc?
if(gs.scoped) // the state of this needs to be verified in a number of places! (flowtron:2010jul05)
{
gs.scoped = false;
sendf(-1, 1, "ri3", SV_SCOPE, c->clientnum, gs.scoped);
}
*/
sendf(-1, 1, "ri3", SV_RELOAD, c->clientnum, e.gun);
if(gs.gunwait[e.gun] && wait<gs.gunwait[e.gun]) gs.gunwait[e.gun] += reloadtime(e.gun);
else
+4 -4
View File
@@ -1083,7 +1083,7 @@ void sniperrifle::attackfx(const vec &from, const vec &to, int millis)
bool sniperrifle::reload()
{
bool r = weapon::reload();
if(owner==player1 && r) scoped = false;
if(owner==player1 && r) { scoped = false; addmsg(SV_SCOPE, "ri2", lastmillis, 0); }
return r;
}
@@ -1102,9 +1102,9 @@ int sniperrifle::dynspread()
}
float sniperrifle::dynrecoil() { return scoped && lastmillis - scoped_since > SCOPESETTLETIME ? info.recoil / 3 : info.recoil; }
bool sniperrifle::selectable() { return weapon::selectable() && !m_noprimary && this == owner->primweap; }
void sniperrifle::onselecting() { weapon::onselecting(); scoped = false; }
void sniperrifle::ondeselecting() { scoped = false; }
void sniperrifle::onownerdies() { scoped = false; }
void sniperrifle::onselecting() { weapon::onselecting(); scoped = false; addmsg(SV_SCOPE, "ri2", lastmillis, 0); }
void sniperrifle::ondeselecting() { scoped = false; addmsg(SV_SCOPE, "ri2", lastmillis, 0); }
void sniperrifle::onownerdies() { scoped = false; addmsg(SV_SCOPE, "ri2", lastmillis, 0); }
void sniperrifle::renderhudmodel() { if(!scoped) weapon::renderhudmodel(); }
void sniperrifle::renderaimhelp(bool teamwarning)