signal scoping over network

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4321 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
flowtron
2009-04-10 21:37:36 +00:00
parent 2025bff3c1
commit 6d9e647f88
7 changed files with 132 additions and 82 deletions
+15
View File
@@ -426,6 +426,21 @@ void parsemessages(int cn, playerent *d, ucharbuf &p)
break;
}
case SV_SCOPE:
{
int cn = getint(p), val = getint(p);
playerent *p = cn==getclientnum() ? player1 : getclient(cn);
if(!p || p==player1) break;
if(p->weaponsel->type != GUN_SNIPER)
{
conoutf("bad scope-message for %s", p->name);
break;
}
sniperrifle *sr = (sniperrifle *)p->weaponsel;
sr->setscope(val);
break;
}
case SV_GIBDAMAGE:
case SV_DAMAGE:
{