From de1e858d9bcdb094e29bc307253fd3d38bbf07e9 Mon Sep 17 00:00:00 2001 From: driAn Date: Fri, 3 Nov 2006 22:03:36 +0000 Subject: [PATCH] no message git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@468 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/clientgame.cpp | 2 +- source/src/console.cpp | 2 +- source/src/menus.cpp | 4 ++-- source/src/protos.h | 2 +- source/src/renderextras.cpp | 4 ++-- source/src/server.cpp | 4 ++-- source/src/weapon.cpp | 30 +++++++++++++++++++++++++----- source/vcpp/cube.suo | Bin 26112 -> 20992 bytes 8 files changed, 34 insertions(+), 14 deletions(-) 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 becf95691a9cdcda44a98860371515056b7c1dae..e1226d17a98f99079d14cd57810316da82158cca 100644 GIT binary patch delta 974 zcmZwFNla5g7zgnA9*>qnLEwQvQlwfas0o&!5rc^e8i)&6Js1(AQZ=i1vM_UB8VdHoV%4CSyz?7}mb`%;fh ziAL^Sq7>r_sN!{LYh`y@7=?x64-;j{QG2Uu%2Y9hmMNQN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