From 66f8feee3bc4a2beff1ee20e69bd0aacec6534b3 Mon Sep 17 00:00:00 2001 From: aerkefiende Date: Mon, 12 Nov 2012 22:28:11 +0000 Subject: [PATCH] Replaced every tab with 4 spaces git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6927 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/clientgame.cpp | 16 ++++++------ source/src/clients2c.cpp | 6 ++--- source/src/console.cpp | 4 +-- source/src/hudgun.h | 2 +- source/src/menus.cpp | 4 +-- source/src/renderhud.cpp | 48 +++++++++++++++++----------------- source/src/renderparticles.cpp | 4 +-- source/src/serverchecks.h | 4 +-- source/src/weapon.cpp | 32 +++++++++++------------ 9 files changed, 60 insertions(+), 60 deletions(-) diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 3c05b03a..428e0e3d 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -428,14 +428,14 @@ botent *newbotent() // create a new blank player setskin(d, rnd(6)); weapon::equipplayer(d); spawnstate(d); // move like above - int nextcn = 0; - bool lukin = true; - while(lukin) - { - bool used = nextcn==getclientnum(); - loopv(players) if(!used && players[i]) if(players[i]->clientnum==nextcn) used = true; - if(!used) lukin = false; else nextcn++; - } + int nextcn = 0; + bool lukin = true; + while(lukin) + { + bool used = nextcn==getclientnum(); + loopv(players) if(!used && players[i]) if(players[i]->clientnum==nextcn) used = true; + if(!used) lukin = false; else nextcn++; + } loopv(players) if(i!=getclientnum() && !players[i]) { players[i] = d; diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index 9ff97bcd..b6835d06 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -649,9 +649,9 @@ void parsemessages(int cn, playerent *d, ucharbuf &p, bool demo = false) if(val) d->state = CS_EDITING; else { - //2011oct16:flowtron:keep spectator state - //specators shouldn't be allowed to toggle editmode for themselves. they're ghosts! - d->state = d->state==CS_SPECTATE?CS_SPECTATE:CS_ALIVE; + //2011oct16:flowtron:keep spectator state + //specators shouldn't be allowed to toggle editmode for themselves. they're ghosts! + d->state = d->state==CS_SPECTATE?CS_SPECTATE:CS_ALIVE; } break; } diff --git a/source/src/console.cpp b/source/src/console.cpp index ab92375c..239e1036 100644 --- a/source/src/console.cpp +++ b/source/src/console.cpp @@ -487,13 +487,13 @@ void consolekey(int code, bool isdown, int cooked) scrolldoc(4); break; - case SDL_AC_BUTTON_WHEELUP: + case SDL_AC_BUTTON_WHEELUP: case SDLK_UP: if(histpos > history.length()) histpos = history.length(); if(histpos > 0) history[--histpos]->restore(); break; - case SDL_AC_BUTTON_WHEELDOWN: + case SDL_AC_BUTTON_WHEELDOWN: case SDLK_DOWN: if(histpos + 1 < history.length()) history[++histpos]->restore(); break; diff --git a/source/src/hudgun.h b/source/src/hudgun.h index 47b5f286..91bd7a19 100644 --- a/source/src/hudgun.h +++ b/source/src/hudgun.h @@ -115,7 +115,7 @@ void preload_hudguns() { loopi(NUMGUNS) { - defformatstring(widn)("modmdlweap%d", i); + defformatstring(widn)("modmdlweap%d", i); defformatstring(path)("weapons/%s", identexists(widn)?getalias(widn):guns[i].modelname); loadmodel(path); } diff --git a/source/src/menus.cpp b/source/src/menus.cpp index 592de38f..d6e8d1d4 100644 --- a/source/src/menus.cpp +++ b/source/src/menus.cpp @@ -1045,13 +1045,13 @@ bool menukey(int code, bool isdown, int unicode, SDLMod mod) else menusel += pagesize; break; case SDLK_ESCAPE: - case SDL_AC_BUTTON_RIGHT: + case SDL_AC_BUTTON_RIGHT: if(!curmenu->allowinput) return false; menuset(menustack.empty() ? NULL : menustack.pop(), false); return true; break; case SDLK_UP: - case SDL_AC_BUTTON_WHEELUP: + case SDL_AC_BUTTON_WHEELUP: if(!curmenu->allowinput) return false; menusel--; break; diff --git a/source/src/renderhud.cpp b/source/src/renderhud.cpp index 35547eb5..8febac58 100644 --- a/source/src/renderhud.cpp +++ b/source/src/renderhud.cpp @@ -108,8 +108,8 @@ void drawsgpat(int w, int h) int rgbcv = 0; loopi(8+1) { - /* if((i%3)==0) { glColor3ub(rgbcv,rgbcv,rgbcv); rgbcv += 4; //rgbcv -= 255/(8+1); }*/ - if(i%2) glColor3ub(64,64,64); else glColor3ub(32,32,32); + /* if((i%3)==0) { glColor3ub(rgbcv,rgbcv,rgbcv); rgbcv += 4; //rgbcv -= 255/(8+1); }*/ + if(i%2) glColor3ub(64,64,64); else glColor3ub(32,32,32); float c = 0.5f*(1 + border*cosf(i*2*M_PI/8.0f)), s = 0.5f*(1 + border*sinf(i*2*M_PI/8.0f)); glVertex2f(x1 + c*sz, y1 + s*sz); } @@ -122,8 +122,8 @@ void drawsgpat(int w, int h) glBegin(GL_TRIANGLE_STRIP); loopi(8+1) { - /* if((i%3)==0) { glColor3ub(rgbcv,rgbcv,rgbcv); //,128); rgbcv += 8; //rgbcv -= 255/(8+1); }*/ - if(i%2) glColor3ub(16,16,16); else glColor3ub(32,32,32); + /* if((i%3)==0) { glColor3ub(rgbcv,rgbcv,rgbcv); //,128); rgbcv += 8; //rgbcv -= 255/(8+1); }*/ + if(i%2) glColor3ub(16,16,16); else glColor3ub(32,32,32); float c = 0.5f*(1 + border*cosf(i*2*M_PI/8.0f)), s = 0.5f*(1 + border*sinf(i*2*M_PI/8.0f)); glVertex2f(x1 + c*sz, y1 + s*sz); c = c < 0.4f ? 0 : (c > 0.6f ? 1 : 0.5f); @@ -138,28 +138,28 @@ void drawsgpat(int w, int h) if(!pattex) pattex = textureload("packages/misc/sgpat.png", 4); loopk(3) { - switch(k) - { - case 0: glColor3ub( 32, 250, 250); break; // center - case 1: glColor3ub( 250, 64, 64); break; // middle - case 2: glColor3ub( 250, 250, 64); break; // outer - default: glColor3ub( 255, 255, 255); break; - } - extern sgray pat[SGRAYS*3]; - int j = k * SGRAYS; - loopi(SGRAYS) - { - if(pattex) - { - vec p = pat[j+i].rv; - int ppx = VIRTW/2 + p.x*(sz/2); - int ppy = VIRTH/2 + p.y*(sz/2); - drawicon(pattex, ppx, ppy, 16, 1, 1, 1); - } - } + switch(k) + { + case 0: glColor3ub( 32, 250, 250); break; // center + case 1: glColor3ub( 250, 64, 64); break; // middle + case 2: glColor3ub( 250, 250, 64); break; // outer + default: glColor3ub( 255, 255, 255); break; + } + extern sgray pat[SGRAYS*3]; + int j = k * SGRAYS; + loopi(SGRAYS) + { + if(pattex) + { + vec p = pat[j+i].rv; + int ppx = VIRTW/2 + p.x*(sz/2); + int ppy = VIRTH/2 + p.y*(sz/2); + drawicon(pattex, ppx, ppy, 16, 1, 1, 1); + } + } } glEnable(GL_BLEND); - /* + /* // 2011may31: dmg/hits output comes upon each shot, let the pattern be shown "pure" extern int lastsgs_hits; extern int lastsgs_dmgt; diff --git a/source/src/renderparticles.cpp b/source/src/renderparticles.cpp index 3863bccd..5af6f2ca 100644 --- a/source/src/renderparticles.cpp +++ b/source/src/renderparticles.cpp @@ -271,7 +271,7 @@ static struct parttype { int type; float r, g, b; int gr, tex; float sz; } partt { PT_PART, 1.0f, 0.5f, 0.2f, 20, 0, 0.08f }, // orange: edit mode ent type : "carrot" { PT_PART, 0.5f, 0.5f, 0.5f, 20, 0, 0.08f }, // grey: edit mode ent type : ladder, (pl)clip { PT_PART, 0.0f, 1.0f, 1.0f, 20, 0, 0.08f }, // turquoise: edit mode ent type : CTF-flag - // 2011jun18 : shotty decals + // 2011jun18 : shotty decals { PT_BULLETHOLE, 0.2f, 0.2f, 1.0f, 0, 3, 0.1f }, // hole decal M { PT_BULLETHOLE, 0.2f, 1.0f, 0.2f, 0, 3, 0.1f }, // hole decal C }; @@ -622,7 +622,7 @@ bool addbullethole(dynent *d, const vec &from, const vec &to, float radius, bool vec o(from); o.add(ray.mul(dist)); o.add(vec(surface).normalize().mul(0.01f)); - // 2011jun18: shotty decals + // 2011jun18: shotty decals int tf = type > 0 ? ( type > 1 ? 21 : 20 ) : 7; newparticle(o, surface, bulletholettl, tf); //newparticle(o, surface, bulletholettl, 7); diff --git a/source/src/serverchecks.h b/source/src/serverchecks.h index 173ce9b9..c577a768 100644 --- a/source/src/serverchecks.h +++ b/source/src/serverchecks.h @@ -513,8 +513,8 @@ void check_afk() ( c.state.state == CS_ALIVE && c.upspawnp ) /*|| ( c.state.state == CS_SPECTATE && totalclients >= scl.maxclients ) // only kick spectator if server is full - 2011oct16:flowtron: mmh, that seems reasonable enough .. still, kicking spectators for inactivity seems harsh! disabled ATM, kick them manually if you must. */ - ) - { + ) + { logline(ACLOG_INFO, "[%s] %s %s", c.hostname, c.name, "is afk"); defformatstring(msg)("%s is afk", c.name); sendservmsg(msg); diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 7dfe7d21..ffcbc568 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -646,23 +646,23 @@ void raydamage(vec &from, vec &to, playerent *d) } int numhits = numhits_o + numhits_m + numhits_c; int dmgreal = 0; - float dmg4r = 0.0f; - bool withBONUS = false;//''; + float dmg4r = 0.0f; + bool withBONUS = false;//''; if(SGDMGBONUS) { - float d2o = SGDMGDISTB; - if(o) d2o = vec(from).sub(o->o).magnitude(); - if(d2o <= (SGDMGDISTB/10.0f) && numhits) - { - /* + float d2o = SGDMGDISTB; + if(o) d2o = vec(from).sub(o->o).magnitude(); + if(d2o <= (SGDMGDISTB/10.0f) && numhits) + { + /* float soc = ( SGCCdmg/10.0f * SGDMGTOTAL/100.0f ) + ( SGCMdmg/10.0f * SGDMGTOTAL/100.0f ) + ( SGCOdmg/10.0f * SGDMGTOTAL/100.0f ); float d2t = SGDMGTOTAL - soc; */ - dmg4r += SGDMGBONUS;//d2t; //was: "d2t" == if percentage-points are dangling and we have hits, we have a base-damage value - withBONUS = true; - //printf("established SOC: %.2f | d2t: %.2f\n", soc, d2t); - //if(numhits) dmgreal += int(d2t); - } + dmg4r += SGDMGBONUS;//d2t; //was: "d2t" == if percentage-points are dangling and we have hits, we have a base-damage value + withBONUS = true; + //printf("established SOC: %.2f | d2t: %.2f\n", soc, d2t); + //if(numhits) dmgreal += int(d2t); + } } dmg4r += /*(int)*/( ( SGCOdmg/10.0f * SGDMGTOTAL/100.0f ) * numhits_o/21.0f ); dmg4r += /*(int)*/( ( SGCMdmg/10.0f * SGDMGTOTAL/100.0f ) * numhits_m/21.0f ); @@ -677,10 +677,10 @@ void raydamage(vec &from, vec &to, playerent *d) dmgreal = min(dmgreal, SGMAXDMGABS); } */ - dmgreal = (int) dmg4r; - lastsgs_hits = numhits; - lastsgs_dmgt = dmgreal; -// conoutf("%d [%.3f%s] DMG with %d hits", lastsgs_dmgt, dmg4r, withBONUS ? "\fs\f3+\fr" : "", lastsgs_hits); + dmgreal = (int) dmg4r; + lastsgs_hits = numhits; + lastsgs_dmgt = dmgreal; +// conoutf("%d [%.3f%s] DMG with %d hits", lastsgs_dmgt, dmg4r, withBONUS ? "\fs\f3+\fr" : "", lastsgs_hits); if(numhits) hitpush( dmgreal, o, d, from, to, d->weaponsel->type, lastsgs_hits == SGRAYS*3, dmgreal); // if(numhits) hitpush( dmgreal, o, d, from, to, d->weaponsel->type, dmgreal == SGMAXDMGABS, dmgreal);