diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index fa7adaf4..025faa0e 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -491,7 +491,7 @@ void selfdamage(int damage, int actor, dynent *act, bool gib) // EDIT: AH if(m_ctf) ctf_death(); showscores(true); - if(scoped) togglescope(); + setscope(false); if(act->bIsBot) addmsg(1, 2, SV_DIEDBYBOT, actor); else addmsg(1, 2, gib ? SV_GIBDIED : SV_DIED, actor); player1->lifesequence++; diff --git a/source/src/console.cpp b/source/src/console.cpp index 8e522b3d..0df1b824 100644 --- a/source/src/console.cpp +++ b/source/src/console.cpp @@ -100,7 +100,7 @@ COMMANDN(bind, bindkey, ARG_2STR); void saycommand(char *init) // turns input to the command line on or off { SDL_EnableUNICODE(saycommandon = (init!=NULL)); - if(scoped) togglescope(); + setscope(false); if(!editmode) keyrepeat(saycommandon); if(!init) init = ""; strcpy_s(commandbuf, init); diff --git a/source/src/menus.cpp b/source/src/menus.cpp index 50517507..d82fc3b9 100644 --- a/source/src/menus.cpp +++ b/source/src/menus.cpp @@ -57,7 +57,7 @@ bool rendermenu() { if(vmenu<0) { menustack.setsize(0); return false; }; - if(scoped) togglescope(); + setscope(false); if(vmenu==1) refreshservers(); gmenu &m = menus[vmenu]; @@ -217,7 +217,7 @@ bool menukey(int code, bool isdown) if(isdown) { - if(scoped) togglescope(); + setscope(false); int oldmenusel = menusel; if(code==SDLK_ESCAPE) { diff --git a/source/src/protos.h b/source/src/protos.h index 5b1f028f..7f82078f 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -175,7 +175,6 @@ extern void rendershotlines(); extern void shotlinereset(); extern void renderphysents(); extern bool scoped; -extern void togglescope(bool deactivate = false); extern void addgib(dynent *d); extern void loadingscreen(); @@ -262,6 +261,7 @@ extern bool gun_changed; extern bool akimboside; extern void checkweaponswitch(); extern void weaponswitch(int gun); +extern void setscope(bool activate); // Added by Rick extern dynent *botincrosshair(); extern bool intersect(dynent *d, vec &from, vec &to, vec *end = NULL); diff --git a/source/src/renderextras.cpp b/source/src/renderextras.cpp index 12b386a3..ee16b4a8 100644 --- a/source/src/renderextras.cpp +++ b/source/src/renderextras.cpp @@ -308,7 +308,7 @@ void damageblend(int n) { dblend += n; }; VAR(hidestats, 0, 0, 1); VAR(crosshairfx, 0, 1, 1); -VAR(scopefov, 5, 50, 50); +/*VAR(scopefov, 5, 50, 50); bool scoped = false; int oldfov = 100; @@ -320,7 +320,7 @@ void togglescope(bool deactivate) scoped = !scoped; setvar("fov", scoped ? scopefov : oldfov); } -} +}*/ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwater) { diff --git a/source/src/server.cpp b/source/src/server.cpp index 075d363d..d9866985 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -289,7 +289,7 @@ bool vote(char *map, int reqmode, int sender) { if(!valid_client(sender)) return false; - if(configsets.length() && curcfgset < configsets.length() && !configsets[curcfgset].vote) + if(configsets.length() && curcfgset < configsets.length() && !configsets[curcfgset].vote && !clients[sender].ismaster) { sprintf_sd(msg)("%s voted, but voting is currently disabled", clients[sender].name); sendservmsg(msg); @@ -1099,7 +1099,7 @@ void initserver(bool dedicated, int uprate, char *sdesc, char *ip, char *master, { serverpassword = passwd; maxclients = maxcl; - servermsinit(master ? master : "cubebot.bots-united.com/cube/masterserver.cgi/", sdesc, dedicated); + servermsinit(master ? master : "masterserver.cubers.net/cgi-bin/actioncube.pl/", sdesc, dedicated); if(isdedicated = dedicated) { diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 035f86b3..495a2f65 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -49,7 +49,7 @@ void weaponswitch(int gun) void weapon(int gun) { if(m_nogun && gun!=G_MELEE && gun!=G_GRENADE) return; - if(scoped) togglescope(); + setscope(false); if(NADE_IN_HAND || player1->reloading) return; gun %= G_NUM; @@ -84,17 +84,37 @@ void shiftweapon(int i) COMMAND(weapon, ARG_1INT); COMMAND(shiftweapon, ARG_1INT); -void altattack() +VAR(scopefov, 5, 50, 50); +bool scoped = false; +int oldfov = 100; + +void setscope(bool activate) { - if(player1->gunselect == GUN_SNIPER && player1->state!=CS_DEAD) togglescope(); + if(activate == scoped) return; + if(activate) + { + oldfov = getvar("fov"); + setvar("fov", scopefov); + } + else + { + setvar("fov", oldfov); + } + scoped = activate; } -COMMAND(altattack, ARG_NONE); +void altaction(int activate) +{ + //if(player1->gunselect == GUN_SNIPER && player1->state!=CS_DEAD) togglescope(); + if(player1->gunselect == GUN_SNIPER && player1->state!=CS_DEAD) setscope(activate); +} + +COMMAND(altaction, ARG_1INT); void reload(dynent *d) { if(!d || d->reloading) return; - if(d == player1 && scoped) { togglescope(); }; + if(d == player1) setscope(false); bool akimbo = d->gunselect==GUN_PISTOL && d->akimbo!=0; if(d->gunselect==GUN_KNIFE || d->gunselect==GUN_GRENADE) return; diff --git a/source/vcpp/cube.suo b/source/vcpp/cube.suo index becf9569..e1226d17 100644 Binary files a/source/vcpp/cube.suo and b/source/vcpp/cube.suo differ