Show
Ignore:
Files:
1 added
4 removed
74 modified

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r38 r0  
    1 DnC Eggy r1 
    2 ------------ 
    3  
    4     Major features changes 
    5     ----------------------- 
    6     * replace tremulous svn923 "callvote draw" by the old "callvote nextmap" 
    7     * Added !warn admin command, use g_adminWarnMessage to change default 
    8     displayed message. 
    9     * Added jetpack power limit support, using cvar g_jetpackLimit 
    10     * www download (TJW) 
    11     * dretch punt (TJW) 
    12     * Backporting tremulous protocol 
    13     (http://www.mercenariesguild.net/patches/?do=details&task_id=2) 
    14     * New defaults (np) 
    15       * enable friendly fire 
    16       * enable team force balance 
    17       * set vote limit to 2 
    18       * set max client to 12 
    19       * set chat team prefix to 1 
    20       * set mark deconstruct to 0 
    21       * set g_MapsConfigs to "mapconfigs" 
    22     * Credit transfer system (sharing) (mnp) 
    23     * Sudden death modes (tjw) 
    24     * Recovers ckit with blaster (risujin) 
    25     * Set a min admin level to talk during spec (lakitu7) 
    26     * Add a !restart keepteam and !restart switchteam options (lakitu7) 
    27     * Permit to aliens to evolve near overmind, even if there a 
    28     human near (david) 
    29     * Disable chomp during a pounce (tjw) 
    30     * Use a node to teleport to another node (risujin) 
    31     * Add an !info command to print informations about server (benmachine) 
    32     * Add a value to unlagged to give a half-unlagged effect 
    33     * Donate feature to share credits to all team 
    34     * add a g_grangerMode cvar to make alien bulider always respawn basic 
    35     granger when overmind down 
    36     * Add a !slap command (Risujing) 
    37     * Add cvar g_reactorBuildPoints, g_repeaterBuildPoints, 
    38     g_overmindBuildPoints and g_eggBuildPoints, to give buildpoint capacity 
    39     to buildings. Buildings can be built with one of there power generator 
    40     only if generator has enough buildpoints. Enable or disable the feature 
    41     with g_zoneBuildPoints 
    42     * Set a cvar g_autoDonate, which autodonate money to your teammates 
    43     if you reach your max money. 
    44     * Make a flood protection (lakitu7, r1ch) 
    45     * Repeater can be built to s1. Add a g_repeaterOnReactor cvar. If on, 
    46     players selecting a reactor when reactor allready built choose a repeater 
    47     instead. It permit to select a repeater from UI without changes on client. 
    48     * Add arguments to '!' commands and /exec command 
    49     * Add cvar substitution 
    50     * Add commands /if, /math and /concat 
    51     * Add cvars g_version, and cg_version containing game version of game 
    52     binary and cgame binary. 
    53  
    54     Minor features changes 
    55     ----------------------- 
    56     * Prevent connecting players from being vote kicked 
    57     * Max ping override for admins 
    58     * Improved !listadmins, see 
    59     http://www.mercenariesguild.net/patches/?do=details&task_id=89 
    60     * teamkill messages (TJW) 
    61     * vote message in console (TJW) 
    62     * No echo to console (TJW) 
    63     * Colorize chat console messages (Napkin) 
    64     * Display building message (Peoro) 
    65     * Reset credit cost when having full life (Moci) 
    66     * LogOnlyPrintf function (Napkin) 
    67     * Add clientTeamClass log entry (Wolfwings) 
    68     * Stick a spec to a player. If player die, spectator keep player 
    69     following (r1ch) 
    70     * Change team message (Peoro) 
    71     * Improve team messages (Peoro) 
    72     * Namelog show prohibitions (Peoro) 
    73     * Deny black names (np) 
    74     * Privmsg can target console user (npa) 
    75     * Muted can't change name (kristall) 
    76     * Deny names starting with digits to be sure it don't make confusion 
    77     with slot numbers (lakitu7) 
    78     * Add a Realtime entry to logs at mapstart 
    79     * Permit to decon exploding building during SD 
    80     * Make private message are invisible to console and logs 
    81  
    82     Bug fixes/development issues 
    83     ---------------------------- 
    84     * Remove -ffast-math compilation flag (to fix 99 damages pounce 
    85     with a .so game file bug) 
    86     * Fixed team change messages 
    87     * Removed useless checks in team managment system 
    88     * Fix autobalance bug 
    89     * Fix "spawn is NULL" crash bug 
    90     * Fix to bug where crouching and moving wouldn't replenish stamina 
    91     (tremulous svn 1021 - tm) 
    92     * Guid is now checked, a non-valid GUID will be listed as XXX ... 
    93     * Fix color displaying (Napkin) 
    94     * Don't join during warmup fix (Kristall) 
    95     * Random layout fix (Peoro) 
    96     * Make it's possible to build over opponents cadavers 
    97     * Never reloading when having full ammo 
    98     * Reloading weapon and take blaster make blaster reloading 
    99     * Fix building repeater without reactor bug 
    100  
    101 Tremulous svn r992 
    102 ---- 
    103  
    104     To take a look for tremulous svn r992 changelog, type: 
    105     svn log -r992:755 svn://svn.icculus.org/tremulous/trunk 
    106  
    10711.1.0 
    1082----- 
  • Makefile

    r122 r0  
    182182 
    183183  ifeq ($(USE_OPENAL),1) 
    184     BASE_CFLAGS += -DUSE_OPENAL 
     184    BASE_CFLAGS += -DUSE_OPENAL=1 
    185185    ifeq ($(USE_OPENAL_DLOPEN),1) 
    186       BASE_CFLAGS += -DUSE_OPENAL_DLOPEN 
     186      BASE_CFLAGS += -DUSE_OPENAL_DLOPEN=1 
    187187    endif 
    188188  endif 
    189189 
    190190  ifeq ($(USE_CURL),1) 
    191     BASE_CFLAGS += -DUSE_CURL 
     191    BASE_CFLAGS += -DUSE_CURL=1 
    192192    ifeq ($(USE_CURL_DLOPEN),1) 
    193       BASE_CFLAGS += -DUSE_CURL_DLOPEN 
     193      BASE_CFLAGS += -DUSE_CURL_DLOPEN=1 
    194194    endif 
    195195  endif 
    196196 
    197197  ifeq ($(USE_CODEC_VORBIS),1) 
    198     BASE_CFLAGS += -DUSE_CODEC_VORBIS 
    199   endif 
    200  
    201   OPTIMIZE = -O2 -funroll-loops -fomit-frame-pointer 
     198    BASE_CFLAGS += -DUSE_CODEC_VORBIS=1 
     199  endif 
     200 
     201  OPTIMIZE = -O3 -ffast-math -funroll-loops -fomit-frame-pointer 
    202202 
    203203  ifeq ($(ARCH),x86_64) 
    204     OPTIMIZE = -O2 -fomit-frame-pointer -funroll-loops \ 
     204    OPTIMIZE = -O3 -fomit-frame-pointer -ffast-math -funroll-loops \ 
    205205      -falign-loops=2 -falign-jumps=2 -falign-functions=2 \ 
    206206      -fstrength-reduce 
     
    209209  else 
    210210  ifeq ($(ARCH),x86) 
    211     OPTIMIZE = -O2 -march=i586 -fomit-frame-pointer \ 
     211    OPTIMIZE = -O3 -march=i586 -fomit-frame-pointer -ffast-math \ 
    212212      -funroll-loops -falign-loops=2 -falign-jumps=2 \ 
    213213      -falign-functions=2 -fstrength-reduce 
     
    320320 
    321321  ifeq ($(ARCH),ppc) 
    322     OPTIMIZE += -faltivec -O2 
     322    OPTIMIZE += -faltivec -O3 
    323323  endif 
    324324  ifeq ($(ARCH),x86) 
     
    335335 
    336336  ifeq ($(USE_OPENAL),1) 
    337     BASE_CFLAGS += -DUSE_OPENAL 
     337    BASE_CFLAGS += -DUSE_OPENAL=1 
    338338    ifneq ($(USE_OPENAL_DLOPEN),1) 
    339339      CLIENT_LDFLAGS += -framework OpenAL 
    340340    else 
    341       BASE_CFLAGS += -DUSE_OPENAL_DLOPEN 
     341      BASE_CFLAGS += -DUSE_OPENAL_DLOPEN=1 
    342342    endif 
    343343  endif 
    344344 
    345345  ifeq ($(USE_CURL),1) 
    346     BASE_CFLAGS += -DUSE_CURL 
     346    BASE_CFLAGS += -DUSE_CURL=1 
    347347    ifneq ($(USE_CURL_DLOPEN),1) 
    348348      CLIENT_LDFLAGS += -lcurl 
    349349    else 
    350       BASE_CFLAGS += -DUSE_CURL_DLOPEN 
     350      BASE_CFLAGS += -DUSE_CURL_DLOPEN=1 
    351351    endif 
    352352  endif 
    353353 
    354354  ifeq ($(USE_CODEC_VORBIS),1) 
    355     BASE_CFLAGS += -DUSE_CODEC_VORBIS 
     355    BASE_CFLAGS += -DUSE_CODEC_VORBIS=1 
    356356    CLIENT_LDFLAGS += -lvorbisfile -lvorbis -logg 
    357357  endif 
     
    365365    $(LIBSDIR)/macosx/libSDL-1.2.0.dylib 
    366366 
    367   OPTIMIZE += -falign-loops=16 
     367  OPTIMIZE += -ffast-math -falign-loops=16 
    368368 
    369369  ifneq ($(HAVE_VM_COMPILED),true) 
     
    402402 
    403403  ifeq ($(USE_OPENAL),1) 
    404     BASE_CFLAGS += -DUSE_OPENAL=1 -DUSE_OPENAL_DLOPEN 
     404    BASE_CFLAGS += -DUSE_OPENAL=1 -DUSE_OPENAL_DLOPEN=1 
    405405  endif 
    406406 
    407407  ifeq ($(USE_CURL),1) 
    408     BASE_CFLAGS += -DUSE_CURL 
     408    BASE_CFLAGS += -DUSE_CURL=1 
    409409    ifneq ($(USE_CURL_DLOPEN),1) 
    410410      BASE_CFLAGS += -DCURL_STATICLIB 
     
    413413 
    414414  ifeq ($(USE_CODEC_VORBIS),1) 
    415     BASE_CFLAGS += -DUSE_CODEC_VORBIS 
    416   endif 
    417  
    418   OPTIMIZE = -O2 -march=i586 -fno-omit-frame-pointer \ 
     415    BASE_CFLAGS += -DUSE_CODEC_VORBIS=1 
     416  endif 
     417 
     418  OPTIMIZE = -O3 -march=i586 -fno-omit-frame-pointer -ffast-math \ 
    419419    -falign-loops=2 -funroll-loops -falign-jumps=2 -falign-functions=2 \ 
    420420    -fstrength-reduce 
     
    476476 
    477477  ifeq ($(USE_OPENAL),1) 
    478     BASE_CFLAGS += -DUSE_OPENAL 
     478    BASE_CFLAGS += -DUSE_OPENAL=1 
    479479    ifeq ($(USE_OPENAL_DLOPEN),1) 
    480       BASE_CFLAGS += -DUSE_OPENAL_DLOPEN 
     480      BASE_CFLAGS += -DUSE_OPENAL_DLOPEN=1 
    481481    endif 
    482482  endif 
    483483 
    484484  ifeq ($(USE_CODEC_VORBIS),1) 
    485     BASE_CFLAGS += -DUSE_CODEC_VORBIS 
     485    BASE_CFLAGS += -DUSE_CODEC_VORBIS=1 
    486486  endif 
    487487 
    488488  ifeq ($(ARCH),axp) 
    489489    BASE_CFLAGS += -DNO_VM_COMPILED 
    490     RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O2 -funroll-loops \ 
     490    RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3 -ffast-math -funroll-loops \ 
    491491      -fomit-frame-pointer -fexpensive-optimizations 
    492492  else 
    493493  ifeq ($(ARCH),x86) 
    494     RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O2 -mtune=pentiumpro \ 
    495       -march=pentium -fomit-frame-pointer -pipe \ 
     494    RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3 -mtune=pentiumpro \ 
     495      -march=pentium -fomit-frame-pointer -pipe -ffast-math \ 
    496496      -falign-loops=2 -falign-jumps=2 -falign-functions=2 \ 
    497497      -funroll-loops -fstrength-reduce 
     
    568568  BASE_CFLAGS=-Dstricmp=strcasecmp -Xcpluscomm -woff 1185 -mips3 \ 
    569569    -nostdinc -I. -I$(ROOT)/usr/include -DNO_VM_COMPILED 
    570   RELEASE_CFLAGS=$(BASE_CFLAGS) -O2 
     570  RELEASE_CFLAGS=$(BASE_CFLAGS) -O3 
    571571  DEBUG_CFLAGS=$(BASE_CFLAGS) -g 
    572572 
     
    607607    -pipe -DUSE_ICON $(shell sdl-config --cflags) 
    608608 
    609   OPTIMIZE = -O2 -funroll-loops 
     609  OPTIMIZE = -O3 -ffast-math -funroll-loops 
    610610 
    611611  ifeq ($(ARCH),sparc) 
    612     OPTIMIZE = -O2 -falign-loops=2 \ 
     612    OPTIMIZE = -O3 -ffast-math -falign-loops=2 \ 
    613613      -falign-jumps=2 -falign-functions=2 -fstrength-reduce \ 
    614614      -mtune=ultrasparc -mv8plus -mno-faster-structs \ 
     
    616616  else 
    617617  ifeq ($(ARCH),x86) 
    618     OPTIMIZE = -O2 -march=i586 -fomit-frame-pointer \ 
     618    OPTIMIZE = -O3 -march=i586 -fomit-frame-pointer -ffast-math \ 
    619619      -funroll-loops -falign-loops=2 -falign-jumps=2 \ 
    620620      -falign-functions=2 -fstrength-reduce 
     
    652652  BASE_CFLAGS=-DNO_VM_COMPILED 
    653653  DEBUG_CFLAGS=$(BASE_CFLAGS) -g 
    654   RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O2 
     654  RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3 
    655655 
    656656  SHLIBEXT=so 
     
    700700 
    701701ifeq ($(USE_LOCAL_HEADERS),1) 
    702   BASE_CFLAGS += -DUSE_LOCAL_HEADERS 
     702  BASE_CFLAGS += -DUSE_LOCAL_HEADERS=1 
    703703endif 
    704704 
     
    12571257  $(B)/base/game/bg_pmove.o \ 
    12581258  $(B)/base/game/bg_slidemove.o \ 
    1259   $(B)/base/game/bg_lib.o \ 
    12601259  $(B)/base/cgame/cg_consolecmds.o \ 
    12611260  $(B)/base/cgame/cg_buildable.o \ 
     
    12871286 
    12881287CGOBJ = $(CGOBJ_) $(B)/base/cgame/cg_syscalls.o 
    1289 CGVMOBJ = $(CGOBJ_:%.o=%.asm) 
     1288CGVMOBJ = $(CGOBJ_:%.o=%.asm) $(B)/base/game/bg_lib.asm 
    12901289 
    12911290$(B)/base/cgame$(ARCH).$(SHLIBEXT): $(CGOBJ) 
     
    13081307  $(B)/base/game/bg_pmove.o \ 
    13091308  $(B)/base/game/bg_slidemove.o \ 
    1310   $(B)/base/game/bg_lib.o \ 
    13111309  $(B)/base/game/g_mem.o \ 
    13121310  $(B)/base/game/g_active.o \ 
     
    13351333 
    13361334GOBJ = $(GOBJ_) $(B)/base/game/g_syscalls.o 
    1337 GVMOBJ = $(GOBJ_:%.o=%.asm) 
     1335GVMOBJ = $(GOBJ_:%.o=%.asm) $(B)/base/game/bg_lib.asm 
    13381336 
    13391337$(B)/base/game$(ARCH).$(SHLIBEXT): $(GOBJ) 
     
    13591357  \ 
    13601358  $(B)/base/game/bg_misc.o \ 
    1361   $(B)/base/game/bg_lib.o \ 
    13621359  $(B)/base/qcommon/q_math.o \ 
    13631360  $(B)/base/qcommon/q_shared.o 
    13641361 
    13651362UIOBJ = $(UIOBJ_) $(B)/base/ui/ui_syscalls.o 
    1366 UIVMOBJ = $(UIOBJ_:%.o=%.asm) 
     1363UIVMOBJ = $(UIOBJ_:%.o=%.asm) $(B)/base/game/bg_lib.asm 
    13671364 
    13681365$(B)/base/ui$(ARCH).$(SHLIBEXT): $(UIOBJ) 
  • misc/entities.def

    r118 r0  
    10231023 
    10241024-------- KEYS -------- 
    1025 dmg: amount of damage to deal (default: 5) 
     1025damage: amount of damage to deal (default: 5) 
    10261026*/ 
    10271027 
  • src/cgame/cg_buildable.c

    r122 r0  
    9696 
    9797#define CREEP_SIZE            64.0f 
    98 #define CREEP_DISTANCE        64.0f 
    9998 
    10099/* 
     
    133132 
    134133  VectorCopy( cent->currentState.origin2, temp ); 
    135   VectorScale( temp, -CREEP_DISTANCE, temp ); 
     134  VectorScale( temp, -4096, temp ); 
    136135  VectorAdd( temp, cent->lerpOrigin, temp ); 
    137136 
     
    142141  size = CREEP_SIZE * frac; 
    143142 
    144   if( size > 0.0f && tr.fraction < 1.0f ) 
     143  if( size > 0.0f ) 
    145144    CG_ImpactMark( cgs.media.creepShader, origin, cent->currentState.origin2, 
    146145                   0.0f, 1.0f, 1.0f, 1.0f, 1.0f, qfalse, size, qtrue ); 
     
    738737} 
    739738 
    740 /* 
    741 ================== 
    742 CG_BuildableStatusParse 
    743 ================== 
    744 */ 
     739 
    745740void CG_BuildableStatusParse( const char *filename, buildStat_t *bs ) 
    746741{ 
     
    913908  if( !bs->loaded ) 
    914909    return; 
    915  
     910   
    916911  d = Distance( cent->lerpOrigin, cg.refdef.vieworg ); 
    917912  if( d > STATUS_MAX_VIEW_DIST ) 
    918913    return; 
    919  
     914  
    920915  Vector4Copy( bs->foreColor, color ); 
    921916 
    922   // trace for center point 
     917  // trace for center point  
    923918  BG_FindBBoxForBuildable( es->modelindex, mins, maxs ); 
    924919 
     
    10791074      healthColor[ 3 ] = color[ 3 ]; 
    10801075      trap_R_SetColor( healthColor ); 
    1081  
     1076      
    10821077      CG_DrawPic( hX, hY, hW, hH, cgs.media.whiteShader ); 
    10831078      trap_R_SetColor( NULL ); 
     
    10951090      oX -= ( oW * 0.5f ); 
    10961091      oY -= ( oH * 0.5f ); 
    1097  
     1092  
    10981093      trap_R_SetColor( frameColor ); 
    10991094      CG_DrawPic( oX, oY, oW, oH, bs->overlayShader ); 
     
    11271122      if( health > 0 && healthPoints < 1 ) 
    11281123        healthPoints = 1; 
    1129       nX = picX + ( picW * 0.5f ) - 2.0f - ( ( subH * 4 ) * 0.5f ); 
    1130  
     1124      nX = picX + ( picW * 0.5f ) - 2.0f - ( ( subH * 4 ) * 0.5f );  
     1125        
    11311126      if( healthPoints > 999 ) 
    11321127        nX -= 0.0f; 
     
    11371132      else 
    11381133        nX -= subH * 1.5f; 
    1139  
     1134      
    11401135      CG_DrawField( nX, subY, 4, subH, subH, healthPoints ); 
    11411136    } 
     
    11441139} 
    11451140 
    1146 /* 
    1147 ================== 
    1148 CG_SortDistance 
    1149 ================== 
    1150 */ 
    1151 static int CG_SortDistance( const void *a, const void *b ) 
     1141static int QDECL CG_SortDistance( const void *a, const void *b ) 
    11521142{ 
    11531143  centity_t    *aent, *bent; 
     
    11681158/* 
    11691159================== 
    1170 CG_PlayerIsBuilder 
    1171 ================== 
    1172 */ 
    1173 static qboolean CG_PlayerIsBuilder( buildable_t buildable ) 
    1174 { 
    1175   switch( cg.predictedPlayerState.weapon ) 
    1176   { 
    1177     case WP_ABUILD: 
    1178     case WP_ABUILD2: 
    1179     case WP_HBUILD: 
    1180     case WP_HBUILD2: 
    1181       return BG_FindTeamForBuildable( buildable ) == 
    1182              BG_FindTeamForWeapon( cg.predictedPlayerState.weapon ); 
    1183  
    1184     default: 
    1185       return qfalse; 
    1186   } 
    1187 } 
    1188  
    1189 /* 
    1190 ================== 
    1191 CG_BuildableRemovalPending 
    1192 ================== 
    1193 */ 
    1194 static qboolean CG_BuildableRemovalPending( int entityNum ) 
    1195 { 
    1196   int           i; 
    1197   playerState_t *ps = &cg.snap->ps; 
    1198  
    1199   if( !( ps->stats[ STAT_BUILDABLE ] & SB_VALID_TOGGLEBIT ) ) 
    1200     return qfalse; 
    1201  
    1202   for( i = 0; i < MAX_POWERUPS; i++ ) 
    1203   { 
    1204     if( ps->powerups[ i ] == entityNum ) 
    1205       return qtrue; 
    1206   } 
    1207  
    1208   return qfalse; 
    1209 } 
    1210  
    1211 /* 
    1212 ================== 
    12131160CG_DrawBuildableStatus 
    12141161================== 
     
    12221169  int             buildables = 0; 
    12231170 
    1224   for( i = 0; i < cg.snap->numEntities; i++ ) 
    1225   { 
    1226     cent  = &cg_entities[ cg.snap->entities[ i ].number ]; 
    1227     es    = &cent->currentState; 
    1228  
    1229     if( es->eType == ET_BUILDABLE && CG_PlayerIsBuilder( es->modelindex ) ) 
    1230       buildableList[ buildables++ ] = cg.snap->entities[ i ].number; 
    1231   } 
    1232  
    1233   qsort( buildableList, buildables, sizeof( int ), CG_SortDistance ); 
    1234   for( i = 0; i < buildables; i++ ) 
    1235     CG_BuildableStatusDisplay( &cg_entities[ buildableList[ i ] ] ); 
     1171  switch( cg.predictedPlayerState.weapon ) 
     1172  { 
     1173    case WP_ABUILD: 
     1174    case WP_ABUILD2: 
     1175    case WP_HBUILD: 
     1176    case WP_HBUILD2: 
     1177      for( i = 0; i < cg.snap->numEntities; i++ ) 
     1178      { 
     1179        cent  = &cg_entities[ cg.snap->entities[ i ].number ]; 
     1180        es    = &cent->currentState; 
     1181 
     1182        if( es->eType == ET_BUILDABLE && 
     1183            BG_FindTeamForBuildable( es->modelindex ) == 
     1184            BG_FindTeamForWeapon( cg.predictedPlayerState.weapon ) ) 
     1185          buildableList[ buildables++ ] = cg.snap->entities[ i ].number; 
     1186      } 
     1187      qsort( buildableList, buildables, sizeof( int ), CG_SortDistance ); 
     1188      for( i = 0; i < buildables; i++ ) 
     1189          CG_BuildableStatusDisplay( &cg_entities[ buildableList[ i ] ] ); 
     1190      break; 
     1191 
     1192    default: 
     1193      break; 
     1194  } 
    12361195} 
    12371196 
     
    13231282    ent.nonNormalizedAxes = qfalse; 
    13241283 
    1325   if( CG_PlayerIsBuilder( es->modelindex ) && CG_BuildableRemovalPending( es->number ) ) 
    1326     ent.customShader = cgs.media.redBuildShader; 
    13271284 
    13281285  //add to refresh list 
     
    13681325      turretBarrel.nonNormalizedAxes = qfalse; 
    13691326 
    1370     if( CG_PlayerIsBuilder( es->modelindex ) && CG_BuildableRemovalPending( es->number ) ) 
    1371       turretBarrel.customShader = cgs.media.redBuildShader; 
    1372  
    13731327    trap_R_AddRefEntityToScene( &turretBarrel ); 
    13741328  } 
     
    14121366    else 
    14131367      turretTop.nonNormalizedAxes = qfalse; 
    1414  
    1415     if( CG_PlayerIsBuilder( es->modelindex ) && CG_BuildableRemovalPending( es->number ) ) 
    1416       turretTop.customShader = cgs.media.redBuildShader; 
    14171368 
    14181369    trap_R_AddRefEntityToScene( &turretTop ); 
  • src/cgame/cg_consolecmds.c

    r118 r0  
    9292    // so request new ones 
    9393    cg.scoresRequestTime = cg.time; 
     94    //TA: added \n SendClientCommand doesn't call flush( )? 
    9495    trap_SendClientCommand( "score\n" ); 
    9596 
     
    239240  cmd = CG_Argv( 0 ); 
    240241 
    241   // ugly hacky special case 
     242  //TA: ugly hacky special case 
    242243  if( !Q_stricmp( cmd, "ui_menu" ) ) 
    243244  { 
  • src/cgame/cg_draw.c

    r122 r0  
    7575      { 
    7676        glyph = &font->glyphs[ (int)*s ]; 
     77        //TTimo: FIXME: getting nasty warnings without the cast, 
     78        //hopefully this doesn't break the VM build 
    7779        out += glyph->xSkip; 
    7880        s++; 
     
    9193  glyphInfo_t *glyph; 
    9294  float       useScale; 
     95// TTimo: FIXME 
     96//  const unsigned char *s = text; 
    9397  const char  *s = text; 
    9498  fontInfo_t  *font = &cgDC.Assets.textFont; 
     
    119123      { 
    120124        glyph = &font->glyphs[ (int)*s ]; 
     125        //TTimo: FIXME: getting nasty warnings without the cast, 
     126        //hopefully this doesn't break the VM build 
    121127        if( max < glyph->height ) 
    122128          max = glyph->height; 
     
    158164  if( text ) 
    159165  { 
    160  
     166// TTimo: FIXME 
     167//    const unsigned char *s = text; 
    161168    const char *s = text; 
    162169 
     
    172179    { 
    173180      glyph = &font->glyphs[ (int)*s ]; 
     181      //TTimo: FIXME: getting nasty warnings without the cast, 
     182      //hopefully this doesn't break the VM build 
    174183 
    175184      if( Q_IsColorString( s ) ) 
     
    285294CG_DrawFieldPadded 
    286295 
    287 Draws large numbers for status bar 
     296Draws large numbers for status bar and powerups 
    288297============== 
    289298*/ 
     
    365374CG_DrawField 
    366375 
    367 Draws large numbers for status bar 
     376Draws large numbers for status bar and powerups 
    368377============== 
    369378*/ 
     
    790799static void CG_DrawPlayerBoosted( rectDef_t *rect, vec4_t color, qhandle_t shader ) 
    791800{ 
    792   if( cg.boostedTime >= 0 ) 
     801  playerState_t *ps = &cg.snap->ps; 
     802  qboolean      boosted = ps->stats[ STAT_STATE ] & SS_BOOSTED; 
     803 
     804  if( boosted ) 
    793805    color[ 3 ] = AH_MAX_ALPHA; 
    794806  else 
     
    807819static void CG_DrawPlayerBoosterBolt( rectDef_t *rect, vec4_t color, qhandle_t shader ) 
    808820{ 
     821  playerState_t *ps = &cg.snap->ps; 
     822  qboolean      boosted = ps->stats[ STAT_STATE ] & SS_BOOSTED; 
    809823  vec4_t        localColor; 
    810824 
    811825  Vector4Copy( color, localColor ); 
    812826 
    813   if( cg.boostedTime >= 0 ) 
    814   { 
    815     if( ( cg.time - cg.boostedTime ) > BOOST_TIME - 3000 ) 
     827  if( boosted ) 
     828  { 
     829    if( ps->stats[ STAT_BOOSTTIME ] > BOOST_TIME - 3000 ) 
    816830    { 
    817       qboolean flash = ( cg.time / 500 ) % 2; 
     831      qboolean flash = ( ps->stats[ STAT_BOOSTTIME ] / 500 ) % 2; 
    818832 
    819833      if( flash ) 
     
    927941 
    928942      default: 
    929                 BG_UnpackAmmoArray( cent->currentState.weapon, ps->ammo, ps->powerups, &value, NULL ); 
     943        BG_UnpackAmmoArray( cent->currentState.weapon, ps->ammo, ps->powerups, &value, NULL ); 
    930944        break; 
    931945    } 
     
    10861100 
    10871101      default: 
    1088                 BG_UnpackAmmoArray( cent->currentState.weapon, ps->ammo, ps->powerups, NULL, &value ); 
     1102        BG_UnpackAmmoArray( cent->currentState.weapon, ps->ammo, ps->powerups, NULL, &value ); 
    10891103 
    10901104        if( value > -1 ) 
     
    14151429 
    14161430        BG_UnpackAmmoArray( cent->currentState.weapon, ps->ammo, ps->powerups, 
    1417           &value, NULL ); 
     1431           &value, NULL ); 
    14181432 
    14191433        return value; 
     
    14211435      break; 
    14221436    case CG_PLAYER_CLIPS_VALUE: 
    1423       if( cent->currentState.weapon ) 
    14241437      if( cent->currentState.weapon ) 
    14251438      { 
     
    14271440 
    14281441        BG_UnpackAmmoArray( cent->currentState.weapon, ps->ammo, ps->powerups, 
    1429           NULL, &value ); 
     1442           NULL, &value ); 
    14301443 
    14311444        return value; 
     
    14741487  if( text ) 
    14751488  { 
     1489// TTimo: FIXME 
     1490//    const unsigned char *s = text; // bk001206 - unsigned 
    14761491    const char *s = text; 
    14771492    float max = *maxX; 
     
    14961511    { 
    14971512      glyph = &font->glyphs[ (int)*s ]; 
     1513      //TTimo: FIXME: getting nasty warnings without the cast, 
     1514      //hopefully this doesn't break the VM build 
    14981515 
    14991516      if( Q_IsColorString( s ) ) 
     
    15631580        if( cg.spectatorOffset < cg.spectatorLen ) 
    15641581        { 
    1565           // skip colour directives 
     1582          //TA: skip colour directives 
    15661583          if( Q_IsColorString( &cg.spectatorList[ cg.spectatorOffset ] ) ) 
    15671584            cg.spectatorOffset += 2; 
     
    16931710================== 
    16941711*/ 
     1712//TA: personally i think this should be longer - it should really be a cvar 
    16951713#define FPS_FRAMES  20 
    16961714#define FPS_STRING  "fps" 
     
    32703288  } 
    32713289 
     3290  //TA: draw the lighting effects e.g. nvg 
    32723291  CG_DrawLighting( ); 
    32733292 
  • src/cgame/cg_event.c

    r118 r0  
    4040  const char    *targetInfo; 
    4141  const char    *attackerInfo; 
    42   char          targetName[ MAX_NAME_LENGTH ]; 
    43   char          attackerName[ MAX_NAME_LENGTH ]; 
     42  char          targetName[ 32 ]; 
     43  char          attackerName[ 32 ]; 
    4444  char          className[ 64 ]; 
    4545  gender_t      gender; 
     
    7373    return; 
    7474 
    75   Q_strncpyz( targetName, Info_ValueForKey( targetInfo, "n" ), sizeof( targetName )); 
     75  Q_strncpyz( targetName, Info_ValueForKey( targetInfo, "n" ), sizeof( targetName ) - 2 ); 
     76  strcat( targetName, S_COLOR_WHITE ); 
    7677 
    7778  message2 = ""; 
     
    182183  if( message ) 
    183184  { 
    184     CG_Printf( "%s" S_COLOR_WHITE " %s.\n", targetName, message ); 
     185    CG_Printf( "%s %s.\n", targetName, message ); 
    185186    return; 
    186187  } 
     
    194195  else 
    195196  { 
    196     Q_strncpyz( attackerName, Info_ValueForKey( attackerInfo, "n" ), sizeof( attackerName )); 
     197    Q_strncpyz( attackerName, Info_ValueForKey( attackerInfo, "n" ), sizeof( attackerName ) - 2); 
     198    strcat( attackerName, S_COLOR_WHITE ); 
    197199    // check for kill messages about the current clientNum 
    198200    if( target == cg.snap->ps.clientNum ) 
     
    328330    if( message ) 
    329331    { 
    330       CG_Printf( "%s" S_COLOR_WHITE " %s %s%s%s\n", 
     332      CG_Printf( "%s %s %s%s%s\n", 
    331333        targetName, message, 
    332334        ( teamKill ) ? S_COLOR_RED "TEAMMATE " S_COLOR_WHITE : "", 
  • src/cgame/cg_local.h

    r122 r0  
    552552// client numbering range 
    553553 
    554 // smoothing of view and model for WW transitions 
     554//TA: smoothing of view and model for WW transitions 
    555555#define   MAXSMOOTHS          32 
    556556 
     
    635635  lerpFrame_t           lerpFrame; 
    636636 
     637  //TA: 
    637638  buildableAnimNumber_t buildableAnim;    //persistant anim number 
    638639  buildableAnimNumber_t oldBuildableAnim; //to detect when new anims are set 
     
    725726  int         teamTask;                   // task in teamplay (offence/defence) 
    726727  qboolean    teamLeader;                 // true when this is a team leader 
     728 
     729  int         powerups;                   // so can display quad/flag status 
    727730 
    728731  int         medkitUsageTime; 
     
    867870//====================================================================== 
    868871 
     872//TA: 
    869873typedef struct 
    870874{ 
     
    10961100  qboolean      testGun; 
    10971101 
    1098   int           spawnTime;                          // fovwarp 
    1099   int           weapon1Time;                        // time when BUTTON_ATTACK went t->f f->t 
    1100   int           weapon2Time;                        // time when BUTTON_ATTACK2 went t->f f->t 
    1101   int           weapon3Time;                        // time when BUTTON_USE_HOLDABLE went t->f f->t 
     1102  int           spawnTime;                          //TA: fovwarp 
     1103  int           weapon1Time;                        //TA: time when BUTTON_ATTACK went t->f f->t 
     1104  int           weapon2Time;                        //TA: time when BUTTON_ATTACK2 went t->f f->t 
     1105  int           weapon3Time;                        //TA: time when BUTTON_USE_HOLDABLE went t->f f->t 
    11021106  qboolean      weapon1Firing; 
    11031107  qboolean      weapon2Firing; 
    11041108  qboolean      weapon3Firing; 
    11051109 
    1106   int           boostedTime; 
    11071110  int           poisonedTime; 
    11081111 
    1109   vec3_t        lastNormal;                         // view smoothage 
    1110   vec3_t        lastVangles;                        // view smoothage 
    1111   smooth_t      sList[ MAXSMOOTHS ];                // WW smoothing 
    1112  
    1113   int           forwardMoveTime;                    // for struggling 
     1112  vec3_t        lastNormal;                         //TA: view smoothage 
     1113  vec3_t        lastVangles;                        //TA: view smoothage 
     1114  smooth_t      sList[ MAXSMOOTHS ];                //TA: WW smoothing 
     1115 
     1116  int           forwardMoveTime;                    //TA: for struggling 
    11141117  int           rightMoveTime; 
    11151118  int           upMoveTime; 
    11161119 
    1117   float         charModelFraction;                  // loading percentages 
     1120  float         charModelFraction;                  //TA: loading percentages 
    11181121  float         mediaFraction; 
    11191122  float         buildablesFraction; 
     
    13651368  clientInfo_t  clientinfo[ MAX_CLIENTS ]; 
    13661369 
    1367   // corpse info 
     1370  //TA: corpse info 
    13681371  clientInfo_t  corpseinfo[ MAX_CLIENTS ]; 
    13691372 
     
    13891392extern  centity_t cg_entities[ MAX_GENTITIES ]; 
    13901393 
     1394//TA: weapon limit expanded: 
     1395//extern  weaponInfo_t  cg_weapons[MAX_WEAPONS]; 
    13911396extern  weaponInfo_t    cg_weapons[ 32 ]; 
     1397//TA: upgrade infos: 
    13921398extern  upgradeInfo_t   cg_upgrades[ 32 ]; 
    13931399 
     1400//TA: buildable infos: 
    13941401extern  buildableInfo_t cg_buildables[ BA_NUM_BUILDABLES ]; 
    13951402 
    13961403extern  markPoly_t      cg_markPolys[ MAX_MARK_POLYS ]; 
    13971404 
    1398 extern  vmCvar_t    cg_version; 
    13991405extern  vmCvar_t    cg_centertime; 
    14001406extern  vmCvar_t    cg_runpitch; 
     
    15121518extern  vmCvar_t    cg_painBlendZoom; 
    15131519 
     1520//TA: hack to get class an carriage through to UI module 
    15141521extern  vmCvar_t    ui_currentClass; 
    15151522extern  vmCvar_t    ui_carriage; 
     
    16261633void        CG_Corpse( centity_t *cent ); 
    16271634void        CG_ResetPlayerEntity( centity_t *cent ); 
     1635void        CG_AddRefEntityWithPowerups( refEntity_t *ent, int powerups, int team ); 
    16281636void        CG_NewClientInfo( int clientNum ); 
    16291637void        CG_PrecacheClientInfo( pClass_t class, char *model, char *skin ); 
  • src/cgame/cg_main.c

    r122 r0  
    2424// cg_main.c -- initialization and primary entry point for cgame 
    2525 
     26 
    2627#include "cg_local.h" 
    27  
    28 #include "../qcommon/q_shared.h" 
    2928 
    3029#include "../ui/ui_shared.h" 
     
    103102centity_t   cg_entities[ MAX_GENTITIES ]; 
    104103 
     104//TA: weapons limit expanded: 
     105//weaponInfo_t    cg_weapons[MAX_WEAPONS]; 
    105106weaponInfo_t    cg_weapons[ 32 ]; 
    106107upgradeInfo_t   cg_upgrades[ 32 ]; 
     
    108109buildableInfo_t cg_buildables[ BA_NUM_BUILDABLES ]; 
    109110 
    110 vmCvar_t  cg_version; 
    111111vmCvar_t  cg_teslaTrailTime; 
    112112vmCvar_t  cg_railTrailTime; 
     
    226226vmCvar_t  cg_painBlendZoom; 
    227227 
     228//TA: hack to get class and carriage through to UI module 
    228229vmCvar_t  ui_currentClass; 
    229230vmCvar_t  ui_carriage; 
     
    251252static cvarTable_t cvarTable[ ] = 
    252253{ 
    253   { &cg_version, "cg_version", FULL_VERSION, CVAR_ROM | CVAR_USERINFO }, 
    254254  { &cg_ignore, "cg_ignore", "0", 0 },  // used for debugging 
    255255  { &cg_autoswitch, "cg_autoswitch", "1", CVAR_ARCHIVE }, 
     
    786786 
    787787 
    788   // building shaders 
     788  //TA: building shaders 
    789789  cgs.media.greenBuildShader          = trap_R_RegisterShader("gfx/misc/greenbuild" ); 
    790790  cgs.media.redBuildShader            = trap_R_RegisterShader("gfx/misc/redbuild" ); 
     
    12221222  } 
    12231223 
    1224   return qfalse; 
     1224  return qfalse; // bk001204 - why not? 
    12251225} 
    12261226 
     
    16151615} 
    16161616 
    1617 // hack to prevent warning 
     1617//TA: hack to prevent warning 
    16181618static qboolean CG_OwnerDrawVisible( int parameter ) 
    16191619{ 
     
    17381738  trap_Cvar_Set( "ui_loading", "1" ); 
    17391739 
    1740   // load overrides 
     1740  //TA: load overrides 
    17411741  BG_InitClassOverrides( ); 
    17421742  BG_InitBuildableOverrides( ); 
    17431743  BG_InitAllowedGameElements( ); 
    17441744 
    1745   // Dynamic memory 
     1745  //TA: dyn memory 
    17461746  CG_InitMemory( ); 
    17471747 
     
    17501750  CG_InitConsoleCommands( ); 
    17511751 
     1752  //TA: moved up for LoadHudMenu 
    17521753  String_Init( ); 
    17531754 
     1755  //TA: TA UI 
    17541756  CG_AssetCache( ); 
    1755   CG_LoadHudMenu( ); 
     1757  CG_LoadHudMenu( );      // load new hud stuff 
    17561758 
    17571759  cg.weaponSelect = WP_NONE; 
    1758   cg.boostedTime = -1; 
    17591760 
    17601761  // old servers 
     
    18021803  CG_UpdateMediaFraction( 1.0f ); 
    18031804 
     1805  //TA: 
    18041806  CG_InitBuildables( ); 
    18051807 
  • src/cgame/cg_players.c

    r122 r0  
    23802380  } 
    23812381 
     2382  //CG_AddRefEntityWithPowerups( &legs, es->powerups, ci->team ); 
    23822383  trap_R_AddRefEntityToScene( &legs ); 
    23832384 
     
    24042405    torso.renderfx = renderfx; 
    24052406 
     2407    //CG_AddRefEntityWithPowerups( &torso, es->powerups, ci->team ); 
    24062408    trap_R_AddRefEntityToScene( &torso ); 
    24072409 
     
    24222424    head.renderfx = renderfx; 
    24232425 
     2426    //CG_AddRefEntityWithPowerups( &head, es->powerups, ci->team ); 
    24242427    trap_R_AddRefEntityToScene( &head ); 
    24252428  } 
  • src/cgame/cg_predict.c

    r122 r0  
    477477  if( fabs( AngleDelta( ps->viewangles[ 0 ], pps->viewangles[ 0 ] ) ) > 1.0f || 
    478478    fabs( AngleDelta( ps->viewangles[ 1 ], pps->viewangles[ 1 ] ) ) > 1.0f || 
    479     fabs( AngleDelta( ps->viewangles[ 2 ], pps->viewangles[ 2 ] ) ) > 1.0f ) 
     479    fabs( AngleDelta( ps->viewangles[ 2 ], pps->viewangles[ 2 ] ) ) > 1.0f )  
    480480  { 
    481481    return 12; 
     
    483483 
    484484  if( pps->viewheight != ps->viewheight ) 
    485     return 13; 
     485        return 13; 
    486486 
    487487  if( pps->damageEvent != ps->damageEvent || 
     
    503503    if( pps->persistant[ i ] != ps->persistant[ i ] ) 
    504504      return 16; 
     505  } 
     506 
     507  for( i = 0; i < MAX_WEAPONS; i++ ) 
     508  { 
     509    if( pps->ammo[ i ] != ps->ammo[ i ] ) 
     510      return 18; 
    505511  } 
    506512 
     
    694700        errorcode = CG_IsUnacceptableError( &cg.predictedPlayerState, 
    695701          &cg.savedPmoveStates[ i ] ); 
    696  
     702   
    697703        if( errorcode ) 
    698704        { 
     
    701707          break; 
    702708        } 
    703  
     709   
    704710        // this one is almost exact, so we'll copy it in as the starting point 
    705711        *cg_pmove.ps = cg.savedPmoveStates[ i ]; 
    706712        // advance the head 
    707713        cg.stateHead = ( i + 1 ) % NUM_SAVED_STATES; 
    708  
     714   
    709715        // set the next command to predict 
    710716        predictCmd = cg.lastPredictedCommand + 1; 
    711  
     717   
    712718        // a saved state matched, so flag it 
    713719        error = qfalse; 
  • src/cgame/cg_scanner.c

    r122 r0  
    6161    if( cent->currentState.eType == ET_BUILDABLE ) 
    6262    { 
    63       // add to list of item positions (for creep) 
     63      //TA: add to list of item positions (for creep) 
    6464      if( cent->currentState.modelindex2 == BIT_ALIENS ) 
    6565      { 
     
    184184  playerState_t *ps = &cg.snap->ps; 
    185185 
    186   BG_GetClientNormal( ps, normal ); 
     186  if( ps->stats[ STAT_STATE ] & SS_WALLCLIMBING ) 
     187  { 
     188    if( ps->stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) 
     189      VectorSet( normal, 0.0f, 0.0f, -1.0f ); 
     190    else 
     191      VectorCopy( ps->grapplePoint, normal ); 
     192  } 
     193  else 
     194    VectorSet( normal, 0.0f, 0.0f, 1.0f ); 
    187195 
    188196  AngleVectors( entityPositions.vangles, view, NULL, NULL ); 
  • src/cgame/cg_servercmds.c

    r122 r1  
    6666 
    6767    cgs.clientinfo[ cg.scores[ i ].client ].score = cg.scores[ i ].score; 
     68    cgs.clientinfo[ cg.scores[ i ].client ].powerups = 0; 
    6869 
    6970    cg.scores[ i ].team = cgs.clientinfo[ cg.scores[ i ].client ].team; 
     
    8687  for( i = 0; i < numSortedTeamPlayers; i++ ) 
    8788  { 
    88     client = atoi( CG_Argv( i * 5 + 2 ) ); 
     89    client = atoi( CG_Argv( i * 6 + 2 ) ); 
    8990 
    9091    sortedTeamPlayers[ i ] = client; 
    9192 
    92     cgs.clientinfo[ client ].location = atoi( CG_Argv( i * 5 + 3 ) ); 
    93     cgs.clientinfo[ client ].health = atoi( CG_Argv( i * 5 + 4 ) ); 
    94     cgs.clientinfo[ client ].armor = atoi( CG_Argv( i * 5 + 5 ) ); 
    95     cgs.clientinfo[ client ].curWeapon = atoi( CG_Argv( i * 5 + 6 ) ); 
     93    cgs.clientinfo[ client ].location = atoi( CG_Argv( i * 6 + 3 ) ); 
     94    cgs.clientinfo[ client ].health = atoi( CG_Argv( i * 6 + 4 ) ); 
     95    cgs.clientinfo[ client ].armor = atoi( CG_Argv( i * 6 + 5 ) ); 
     96    cgs.clientinfo[ client ].curWeapon = atoi( CG_Argv( i * 6 + 6 ) ); 
     97    cgs.clientinfo[ client ].powerups = atoi( CG_Argv( i * 6 + 7 ) ); 
    9698  } 
    9799} 
     
    845847  } 
    846848 
    847   if( !strcmp( cmd, "restartmap" ) ) 
     849  if( !strcmp( cmd, "map_restart" ) ) 
    848850  { 
    849851    CG_MapRestart( ); 
     
    896898  } 
    897899 
     900  if( !strcmp( cmd, "weaponswitch" ) ) 
     901  { 
     902    CG_Printf( "client weaponswitch\n" ); 
     903    if( trap_Argc( ) == 2 ) 
     904    { 
     905      cg.weaponSelect = atoi( CG_Argv( 1 ) ); 
     906      cg.weaponSelectTime = cg.time; 
     907    } 
     908 
     909    return; 
     910  } 
     911 
    898912  // server requests a ptrc 
    899913  if( !strcmp( cmd, "ptrcrequest" ) ) 
  • src/cgame/cg_snapshot.c

    r118 r0  
    142142  // execute any server string commands before transitioning entities 
    143143  CG_ExecuteNewServerCommands( cg.nextSnap->serverCommandSequence ); 
     144 
     145  // if we had a map_restart, set everthing with initial 
     146  if( !cg.snap ) { } //TA: ? 
    144147 
    145148  // clear the currentValid flag for all entities in the existing snapshot 
  • src/cgame/cg_tutorial.c

    r122 r0  
    196196        va( "Press %s to build a structure\n", 
    197197          CG_KeyNameForCommand( "+attack" ) ) ); 
    198   } 
    199  
    200   if( ( es = CG_BuildableInRange( ps, NULL ) ) ) 
    201   { 
    202     if( cgs.markDeconstruct ) 
    203     { 
    204       if( es->generic1 & B_MARKED_TOGGLEBIT ) 
    205       { 
    206         Q_strcat( text, MAX_TUTORIAL_TEXT, 
    207             va( "Press %s to unmark this structure\n", 
     198 
     199    if( ( es = CG_BuildableInRange( ps, NULL ) ) ) 
     200    { 
     201      if( cgs.markDeconstruct ) 
     202      { 
     203        if( es->generic1 & B_MARKED_TOGGLEBIT ) 
     204        { 
     205          Q_strcat( text, MAX_TUTORIAL_TEXT, 
     206              va( "Press %s to unmark this structure\n", 
     207                CG_KeyNameForCommand( "deconstruct" ) ) ); 
     208        } 
     209        else 
     210        { 
     211          Q_strcat( text, MAX_TUTORIAL_TEXT, 
     212              va( "Press %s to mark this structure\n", 
     213                CG_KeyNameForCommand( "deconstruct" ) ) ); 
     214        } 
     215      } 
     216      else 
     217      { 
     218        Q_strcat( text, MAX_TUTORIAL_TEXT, 
     219            va( "Press %s to destroy this structure\n", 
    208220              CG_KeyNameForCommand( "deconstruct" ) ) ); 
    209221      } 
    210       else 
    211       { 
    212         Q_strcat( text, MAX_TUTORIAL_TEXT, 
    213             va( "Press %s to mark this structure\n", 
    214               CG_KeyNameForCommand( "deconstruct" ) ) ); 
    215       } 
    216     } 
    217     else 
    218     { 
    219       Q_strcat( text, MAX_TUTORIAL_TEXT, 
    220           va( "Press %s to destroy this structure\n", 
    221             CG_KeyNameForCommand( "deconstruct" ) ) ); 
    222222    } 
    223223  } 
     
    352352static void CG_HumanCkitText( char *text, playerState_t *ps ) 
    353353{ 
    354   buildable_t   buildable = ps->stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT; 
    355   entityState_t *es; 
    356   float         health; 
     354  buildable_t buildable = ps->stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT; 
     355  float       health; 
    357356 
    358357  if( buildable > BA_NONE ) 
     
    382381              CG_KeyNameForCommand( "+button5" ) ) ); 
    383382      } 
    384     } 
    385   } 
    386  
    387   if( ( es = CG_BuildableInRange( ps, NULL ) ) ) 
    388   { 
    389     if( cgs.markDeconstruct ) 
    390     { 
    391       if( es->generic1 & B_MARKED_TOGGLEBIT ) 
    392       { 
    393         Q_strcat( text, MAX_TUTORIAL_TEXT, 
    394             va( "Press %s to unmark this structure\n", 
    395               CG_KeyNameForCommand( "deconstruct" ) ) ); 
    396       } 
    397       else 
    398       { 
    399         Q_strcat( text, MAX_TUTORIAL_TEXT, 
    400             va( "Press %s to mark this structure\n", 
    401               CG_KeyNameForCommand( "deconstruct" ) ) ); 
    402       } 
    403     } 
    404     else 
    405     { 
     383 
    406384      Q_strcat( text, MAX_TUTORIAL_TEXT, 
    407385          va( "Press %s to destroy this structure\n", 
  • src/cgame/cg_view.c

    r118 r0  
    279279  vec3_t        surfNormal; 
    280280 
    281   BG_GetClientNormal( &cg.predictedPlayerState, surfNormal ); 
     281  if( cg.predictedPlayerState.stats[ STAT_STATE ] & SS_WALLCLIMBING ) 
     282  { 
     283    if( cg.predictedPlayerState.stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) 
     284      VectorSet( surfNormal, 0.0f, 0.0f, -1.0f ); 
     285    else 
     286      VectorCopy( cg.predictedPlayerState.grapplePoint, surfNormal ); 
     287  } 
     288  else 
     289    VectorSet( surfNormal, 0.0f, 0.0f, 1.0f ); 
    282290 
    283291  VectorMA( cg.refdef.vieworg, cg.predictedPlayerState.viewheight, surfNormal, cg.refdef.vieworg ); 
     
    348356{ 
    349357  float         steptime; 
    350   int           timeDelta; 
     358  int            timeDelta; 
    351359  vec3_t        normal; 
    352360  playerState_t *ps = &cg.predictedPlayerState; 
    353361 
    354   BG_GetClientNormal( ps, normal ); 
     362  if( ps->stats[ STAT_STATE ] & SS_WALLCLIMBING ) 
     363  { 
     364    if( ps->stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) 
     365      VectorSet( normal, 0.0f, 0.0f, -1.0f ); 
     366    else 
     367      VectorCopy( ps->grapplePoint, normal ); 
     368  } 
     369  else 
     370    VectorSet( normal, 0.0f, 0.0f, 1.0f ); 
    355371 
    356372  steptime = BG_FindSteptimeForClass( ps->stats[ STAT_PCLASS ] ); 
     
    363379      * (steptime - timeDelta) / steptime; 
    364380 
    365     VectorMA( cg.refdef.vieworg, -stepChange, normal, cg.refdef.vieworg ); 
     381    if( ps->stats[ STAT_STATE ] & SS_WALLCLIMBING ) 
     382      VectorMA( cg.refdef.vieworg, -stepChange, normal, cg.refdef.vieworg ); 
     383    else 
     384      cg.refdef.vieworg[ 2 ] -= stepChange; 
    366385  } 
    367386} 
     
    394413  playerState_t *ps = &cg.predictedPlayerState; 
    395414 
    396   BG_GetClientNormal( ps, normal ); 
     415  if( ps->stats[ STAT_STATE ] & SS_WALLCLIMBING ) 
     416  { 
     417    if( ps->stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) 
     418      VectorSet( normal, 0.0f, 0.0f, -1.0f ); 
     419    else 
     420      VectorCopy( ps->grapplePoint, normal ); 
     421  } 
     422  else 
     423    VectorSet( normal, 0.0f, 0.0f, 1.0f ); 
     424 
    397425 
    398426  if( cg.snap->ps.pm_type == PM_INTERMISSION ) 
     
    616644 
    617645  // add view height 
    618   VectorMA( origin, ps->viewheight, normal, origin ); 
     646  // when wall climbing the viewheight is not straight up 
     647  if( cg.predictedPlayerState.stats[ STAT_STATE ] & SS_WALLCLIMBING ) 
     648    VectorMA( origin, ps->viewheight, normal, origin ); 
     649  else 
     650    origin[ 2 ] += cg.predictedPlayerState.viewheight; 
    619651 
    620652  // smooth out duck height changes 
     
    632664    bob = 6; 
    633665 
    634   VectorMA( origin, bob, normal, origin ); 
     666  // likewise for bob 
     667  if( cg.predictedPlayerState.stats[ STAT_STATE ] & SS_WALLCLIMBING ) 
     668    VectorMA( origin, bob, normal, origin ); 
     669  else 
     670    origin[ 2 ] += bob; 
     671 
    635672 
    636673  // add fall height 
     
    907944 
    908945  //set surfNormal 
    909   BG_GetClientNormal( ps, surfNormal ); 
     946  if( !( ps->stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) ) 
     947    VectorCopy( ps->grapplePoint, surfNormal ); 
     948  else 
     949    VectorCopy( ceilingNormal, surfNormal ); 
    910950 
    911951  AnglesToAxis( in, inAxis ); 
     
    12251265  cg.renderingThirdPerson = cg_thirdPerson.integer || ( cg.snap->ps.stats[ STAT_HEALTH ] <= 0 ); 
    12261266 
    1227   // Infer when we first became boosted 
    1228   if( ( cg.snap->ps.stats[ STAT_STATE ] & SS_BOOSTED ) && cg.boostedTime < 0 ) 
    1229     cg.boostedTime = cg.time; 
    1230   else if( !( cg.snap->ps.stats[ STAT_STATE ] & SS_BOOSTED ) && cg.boostedTime >= 0 ) 
    1231     cg.boostedTime = -1; 
    1232  
    12331267  // build cg.refdef 
    12341268  inwater = CG_CalcViewValues( ); 
  • src/cgame/cg_weapons.c

    r122 r0  
    11101110static qboolean CG_WeaponSelectable( weapon_t weapon ) 
    11111111{ 
     1112  //int ammo, clips; 
     1113  // 
     1114  //BG_UnpackAmmoArray( i, cg.snap->ps.ammo, cg.snap->ps.powerups, &ammo, &clips ); 
     1115  // 
     1116  // this is a pain in the ass 
     1117  //if( !ammo && !clips && !BG_FindInfinteAmmoForWeapon( i ) ) 
     1118  //  return qfalse; 
     1119 
    11121120  if( !BG_InventoryContainsWeapon( weapon, cg.snap->ps.stats ) ) 
    11131121    return qfalse; 
     
    11921200  for( i = WP_NONE + 1; i < WP_NUM_WEAPONS; i++ ) 
    11931201  { 
    1194     int ammo, clips; 
    1195  
    11961202    if( !BG_InventoryContainsWeapon( i, cg.snap->ps.stats ) ) 
    11971203      continue; 
    1198  
    1199     BG_UnpackAmmoArray( i, cg.snap->ps.ammo, cg.snap->ps.powerups, &ammo, &clips ); 
    1200  
    1201     if( !ammo && !clips && !BG_FindInfinteAmmoForWeapon( i ) ) 
    1202       colinfo[ numItems ] = 1; 
    1203     else 
    1204       colinfo[ numItems ] = 0; 
     1204       
     1205    { 
     1206      int ammo, clips; 
     1207   
     1208      BG_UnpackAmmoArray( i, cg.snap->ps.ammo, cg.snap->ps.powerups, &ammo, &clips ); 
     1209   
     1210      if( !ammo && !clips && !BG_FindInfinteAmmoForWeapon( i ) ) 
     1211        colinfo[ numItems ] = 1; 
     1212      else 
     1213        colinfo[ numItems ] = 0; 
     1214         
     1215    } 
    12051216 
    12061217    if( i == cg.weaponSelect ) 
     
    12191230    if( !BG_FindUsableForUpgrade ( i ) ) 
    12201231      colinfo[ numItems ] = 2; 
    1221  
     1232     
    12221233 
    12231234    if( i == cg.weaponSelect - 32 ) 
  • src/client/cl_cgame.c

    r54 r0  
    332332        } 
    333333 
    334         if ( !strcmp( cmd, "restartmap" ) ) { 
     334        if ( !strcmp( cmd, "map_restart" ) ) { 
    335335                // clear notify lines and outgoing commands before passing 
    336336                // the restart to the cgame 
  • src/client/cl_console.c

    r118 r0  
    465465 
    466466        Field_Draw( &g_consoleField, con.xadjust + 2 * SMALLCHAR_WIDTH, y, 
    467                 SCREEN_WIDTH - 3 * SMALLCHAR_WIDTH, qtrue, qtrue ); 
     467                SCREEN_WIDTH - 3 * SMALLCHAR_WIDTH, qtrue ); 
    468468} 
    469469 
     
    521521 
    522522                SCR_DrawSmallChar( cls.glconfig.vidWidth - ( i - x ) * SMALLCHAR_WIDTH,  
     523 
    523524                        (lines-(SMALLCHAR_HEIGHT+SMALLCHAR_HEIGHT/2)), Q3_VERSION[x] ); 
    524525 
     
    615616                if( chat_team ) 
    616617                { 
    617                         SCR_DrawBigString( 8, 232, "Team Say:", 1.0f, qfalse ); 
     618                        SCR_DrawBigString( 8, 232, "Team Say:", 1.0f ); 
    618619                        skip = 11; 
    619620                } 
    620621                else 
    621622                {  
    622                         SCR_DrawBigString( 8, 232, "Say:", 1.0f, qfalse ); 
     623                        SCR_DrawBigString( 8, 232, "Say:", 1.0f ); 
    623624                        skip = 5; 
    624625                } 
    625626 
    626627                Field_BigDraw( &chatField, skip * BIGCHAR_WIDTH, 232, 
    627                                 SCREEN_WIDTH - ( skip + 1 ) * BIGCHAR_WIDTH, qtrue, qtrue ); 
     628                                SCREEN_WIDTH - ( skip + 1 ) * BIGCHAR_WIDTH, qtrue ); 
    628629        } 
    629630} 
  • src/client/cl_curl.c

    r118 r0  
    2121*/ 
    2222 
    23 #ifdef USE_CURL 
     23#if USE_CURL 
    2424#include "client.h" 
    2525cvar_t *cl_cURLLib; 
    2626 
    27 #ifdef USE_CURL_DLOPEN 
     27#if USE_CURL_DLOPEN 
    2828#include "../sys/sys_loadlib.h" 
    2929 
     
    8989qboolean CL_cURL_Init() 
    9090{ 
    91 #ifdef USE_CURL_DLOPEN 
     91#if USE_CURL_DLOPEN 
    9292        if(cURLLib) 
    9393                return qtrue; 
     
    157157{ 
    158158        CL_cURL_Cleanup(); 
    159 #ifdef USE_CURL_DLOPEN 
     159#if USE_CURL_DLOPEN 
    160160        if(cURLLib) 
    161161        { 
  • src/client/cl_curl.h

    r118 r0  
    3838#endif 
    3939 
    40 #ifdef USE_LOCAL_HEADERS 
     40#if USE_LOCAL_HEADERS 
    4141  #include "../libcurl/curl/curl.h" 
    4242#else 
     
    4545 
    4646 
    47 #ifdef USE_CURL_DLOPEN 
     47#if USE_CURL_DLOPEN 
    4848extern char* (*qcurl_version)(void); 
    4949 
  • src/client/cl_keys.c

    r118 r0  
    311311=================== 
    312312*/ 
    313 void Field_VariableSizeDraw( field_t *edit, int x, int y, int width, int size, qboolean showCursor, 
    314                 qboolean noColorEscape ) { 
     313void Field_VariableSizeDraw( field_t *edit, int x, int y, int width, int size, qboolean showCursor ) { 
    315314        int             len; 
    316315        int             drawLen; 
     
    353352 
    354353                color[0] = color[1] = color[2] = color[3] = 1.0; 
    355                 SCR_DrawSmallStringExt( x, y, str, color, qfalse, noColorEscape ); 
     354                SCR_DrawSmallStringExt( x, y, str, color, qfalse ); 
    356355        } else { 
    357356                // draw big string with drop shadow 
    358                 SCR_DrawBigString( x, y, str, 1.0, noColorEscape ); 
     357                SCR_DrawBigString( x, y, str, 1.0 ); 
    359358        } 
    360359 
    361360        // draw the cursor 
    362         if ( showCursor ) { 
    363                 if ( (int)( cls.realtime >> 8 ) & 1 ) { 
    364                         return;         // off blink 
    365                 } 
    366  
    367                 if ( key_overstrikeMode ) { 
    368                         cursorChar = 11; 
    369                 } else { 
    370                         cursorChar = 10; 
    371                 } 
    372  
    373                 i = drawLen - strlen( str ); 
    374  
    375                 if ( size == SMALLCHAR_WIDTH ) { 
    376                         SCR_DrawSmallChar( x + ( edit->cursor - prestep - i ) * size, y, cursorChar ); 
    377                 } else { 
    378                         str[0] = cursorChar; 
    379                         str[1] = 0; 
    380                         SCR_DrawBigString( x + ( edit->cursor - prestep - i ) * size, y, str, 1.0, qfalse ); 
    381  
    382                 } 
    383         } 
    384 } 
    385  
    386 void Field_Draw( field_t *edit, int x, int y, int width, qboolean showCursor, qboolean noColorEscape )  
     361        if ( !showCursor ) { 
     362                return; 
     363        } 
     364 
     365        if ( (int)( cls.realtime >> 8 ) & 1 ) { 
     366                return;         // off blink 
     367        } 
     368 
     369        if ( key_overstrikeMode ) { 
     370                cursorChar = 11; 
     371        } else { 
     372                cursorChar = 10; 
     373        } 
     374 
     375        i = drawLen - Q_PrintStrlen( str ); 
     376 
     377        if ( size == SMALLCHAR_WIDTH ) { 
     378                SCR_DrawSmallChar( x + ( edit->cursor - prestep - i ) * size, y, cursorChar ); 
     379        } else { 
     380                str[0] = cursorChar; 
     381                str[1] = 0; 
     382                SCR_DrawBigString( x + ( edit->cursor - prestep - i ) * size, y, str, 1.0 ); 
     383 
     384        } 
     385} 
     386 
     387void Field_Draw( field_t *edit, int x, int y, int width, qboolean showCursor )  
    387388{ 
    388         Field_VariableSizeDraw( edit, x, y, width, SMALLCHAR_WIDTH, showCursor, noColorEscape ); 
    389 } 
    390  
    391 void Field_BigDraw( field_t *edit, int x, int y, int width, qboolean showCursor, qboolean noColorEscape )  
     389        Field_VariableSizeDraw( edit, x, y, width, SMALLCHAR_WIDTH, showCursor ); 
     390} 
     391 
     392void Field_BigDraw( field_t *edit, int x, int y, int width, qboolean showCursor )  
    392393{ 
    393         Field_VariableSizeDraw( edit, x, y, width, BIGCHAR_WIDTH, showCursor, noColorEscape ); 
     394        Field_VariableSizeDraw( edit, x, y, width, BIGCHAR_WIDTH, showCursor ); 
    394395} 
    395396 
  • src/client/cl_main.c

    r122 r0  
    3131cvar_t  *cl_noprint; 
    3232cvar_t  *cl_motd; 
    33 cvar_t  *cl_master; 
     33 
    3434cvar_t  *rcon_client_password; 
    3535cvar_t  *rconAddress; 
     
    737737void CL_ShutdownAll(void) { 
    738738 
    739 #ifdef USE_CURL 
     739#if USE_CURL 
    740740        CL_cURL_Shutdown(); 
    741741#endif 
     
    983983                return; 
    984984        } 
    985         Com_Printf( "Resolving %s\n", cl_master->string ); 
    986         if ( !NET_StringToAdr( cl_master->string, &cls.updateServer  ) ) { 
     985        Com_Printf( "Resolving %s\n", MASTER_SERVER_NAME ); 
     986        if ( !NET_StringToAdr( MASTER_SERVER_NAME, &cls.updateServer  ) ) { 
    987987                Com_Printf( "Couldn't resolve address\n" ); 
    988988                return; 
    989989        } 
    990990        cls.updateServer.port = BigShort( PORT_MASTER ); 
    991         Com_Printf( "%s resolved to %i.%i.%i.%i:%i\n", cl_master->string, 
     991        Com_Printf( "%s resolved to %i.%i.%i.%i:%i\n", MASTER_SERVER_NAME, 
    992992                cls.updateServer.ip[0], cls.updateServer.ip[1], 
    993993                cls.updateServer.ip[2], cls.updateServer.ip[3], 
     
    14161416void CL_DownloadsComplete( void ) { 
    14171417 
    1418 #ifdef USE_CURL 
     1418#if USE_CURL 
    14191419        // if we downloaded with cURL 
    14201420        if(clc.cURLUsed) {  
     
    15471547                else 
    15481548                        s = localName + strlen(localName); // point at the nul byte 
    1549 #ifdef USE_CURL 
     1549#if USE_CURL 
    15501550                if(!(cl_allowDownload->integer & DLF_NO_REDIRECT)) { 
    15511551                        if(clc.sv_allowDownload & DLF_NO_REDIRECT) { 
     
    21632163        } 
    21642164 
    2165 #ifdef USE_CURL 
     2165#if USE_CURL 
    21662166        if(clc.downloadCURLM) { 
    21672167                CL_cURL_PerformDownload(); 
     
    26182618        cl_noprint = Cvar_Get( "cl_noprint", "0", 0 ); 
    26192619        cl_motd = Cvar_Get ("cl_motd", "1", 0); 
    2620   cl_master = Cvar_Get("cl_master","master.tremulous.net",CVAR_ARCHIVE); 
     2620 
    26212621        cl_timeout = Cvar_Get ("cl_timeout", "200", 0); 
    26222622 
     
    26542654 
    26552655        cl_allowDownload = Cvar_Get ("cl_allowDownload", "0", CVAR_ARCHIVE); 
    2656 #ifdef USE_CURL 
     2656#if USE_CURL 
    26572657        cl_cURLLib = Cvar_Get("cl_cURLLib", DEFAULT_CURL_LIB, CVAR_ARCHIVE); 
    26582658#endif 
     
    32303230 
    32313231        if( cls.masterNum == 1 ) { 
    3232                 NET_StringToAdr( cl_master->string, &to ); 
     3232                NET_StringToAdr( MASTER_SERVER_NAME, &to ); 
    32333233                cls.nummplayerservers = -1; 
    32343234                cls.pingUpdateSource = AS_MPLAYER; 
    32353235        } 
    32363236        else { 
    3237                 NET_StringToAdr( cl_master->string, &to ); 
     3237                NET_StringToAdr( MASTER_SERVER_NAME, &to ); 
    32383238                cls.numglobalservers = -1; 
    32393239                cls.pingUpdateSource = AS_GLOBAL; 
  • src/client/cl_scrn.c

    r118 r0  
    198198================== 
    199199*/ 
    200 void SCR_DrawStringExt( int x, int y, float size, const char *string, float *setColor, qboolean forceColor, 
    201                 qboolean noColorEscape ) { 
     200void SCR_DrawStringExt( int x, int y, float size, const char *string, float *setColor, qboolean forceColor ) { 
    202201        vec4_t          color; 
    203202        const char      *s; 
     
    211210        xx = x; 
    212211        while ( *s ) { 
    213                 if ( !noColorEscape && Q_IsColorString( s ) ) { 
     212                if ( Q_IsColorString( s ) ) { 
    214213                        s += 2; 
    215214                        continue; 
     
    226225        re.SetColor( setColor ); 
    227226        while ( *s ) { 
    228                 if ( !noColorEscape && Q_IsColorString( s ) ) { 
     227                if ( Q_IsColorString( s ) ) { 
    229228                        if ( !forceColor ) { 
    230229                                Com_Memcpy( color, g_color_table[ColorIndex(*(s+1))], sizeof( color ) ); 
     
    243242 
    244243 
    245 void SCR_DrawBigString( int x, int y, const char *s, float alpha, qboolean noColorEscape ) { 
     244void SCR_DrawBigString( int x, int y, const char *s, float alpha ) { 
    246245        float   color[4]; 
    247246 
    248247        color[0] = color[1] = color[2] = 1.0; 
    249248        color[3] = alpha; 
    250         SCR_DrawStringExt( x, y, BIGCHAR_WIDTH, s, color, qfalse, noColorEscape ); 
    251 } 
    252  
    253 void SCR_DrawBigStringColor( int x, int y, const char *s, vec4_t color, qboolean noColorEscape ) { 
    254         SCR_DrawStringExt( x, y, BIGCHAR_WIDTH, s, color, qtrue, noColorEscape ); 
     249        SCR_DrawStringExt( x, y, BIGCHAR_WIDTH, s, color, qfalse ); 
     250} 
     251 
     252void SCR_DrawBigStringColor( int x, int y, const char *s, vec4_t color ) { 
     253        SCR_DrawStringExt( x, y, BIGCHAR_WIDTH, s, color, qtrue ); 
    255254} 
    256255 
     
    262261Draws a multi-colored string with a drop shadow, optionally forcing 
    263262to a fixed color. 
    264 ================== 
    265 */ 
    266 void SCR_DrawSmallStringExt( int x, int y, const char *string, float *setColor, qboolean forceColor, 
    267                 qboolean noColorEscape ) { 
     263 
     264Coordinates are at 640 by 480 virtual resolution 
     265================== 
     266*/ 
     267void SCR_DrawSmallStringExt( int x, int y, const char *string, float *setColor, qboolean forceColor ) { 
    268268        vec4_t          color; 
    269269        const char      *s; 
     
    275275        re.SetColor( setColor ); 
    276276        while ( *s ) { 
    277                 if ( !noColorEscape && Q_IsColorString( s ) ) { 
     277                if ( Q_IsColorString( s ) ) { 
    278278                        if ( !forceColor ) { 
    279279                                Com_Memcpy( color, g_color_table[ColorIndex(*(s+1))], sizeof( color ) ); 
  • src/client/client.h

    r122 r0  
    3232#include "../game/bg_public.h" 
    3333 
    34 #ifdef USE_CURL 
     34#if USE_CURL 
    3535#include "cl_curl.h" 
    3636#endif /* USE_CURL */ 
     
    346346extern  cvar_t  *cl_showTimeDelta; 
    347347extern  cvar_t  *cl_freezeDemo; 
    348 extern  cvar_t  *cl_master; 
    349348 
    350349extern  cvar_t  *cl_yawspeed; 
     
    504503void    SCR_DrawNamedPic( float x, float y, float width, float height, const char *picname ); 
    505504 
    506 void    SCR_DrawBigString( int x, int y, const char *s, float alpha, qboolean noColorEscape );                  // draws a string with embedded color control characters with fade 
    507 void    SCR_DrawBigStringColor( int x, int y, const char *s, vec4_t color, qboolean noColorEscape );    // ignores embedded color control characters 
    508 void    SCR_DrawSmallStringExt( int x, int y, const char *string, float *setColor, qboolean forceColor, qboolean noColorEscape ); 
     505void    SCR_DrawBigString( int x, int y, const char *s, float alpha );                  // draws a string with embedded color control characters with fade 
     506void    SCR_DrawBigStringColor( int x, int y, const char *s, vec4_t color );    // ignores embedded color control characters 
     507void    SCR_DrawSmallStringExt( int x, int y, const char *string, float *setColor, qboolean forceColor ); 
    509508void    SCR_DrawSmallChar( int x, int y, int ch ); 
    510509 
  • src/client/keys.h

    r118 r0  
    3535void Field_KeyDownEvent( field_t *edit, int key ); 
    3636void Field_CharEvent( field_t *edit, int ch ); 
    37 void Field_Draw( field_t *edit, int x, int y, int width, qboolean showCursor, qboolean noColorEscape ); 
    38 void Field_BigDraw( field_t *edit, int x, int y, int width, qboolean showCursor, qboolean noColorEscape ); 
     37void Field_Draw( field_t *edit, int x, int y, int width, qboolean showCursor ); 
     38void Field_BigDraw( field_t *edit, int x, int y, int width, qboolean showCursor ); 
    3939 
    4040#define         COMMAND_HISTORY         32 
  • src/client/qal.c

    r118 r0  
    2525// Dynamically loads OpenAL 
    2626 
    27 #ifdef USE_OPENAL 
     27#if USE_OPENAL 
    2828 
    2929#include "qal.h" 
    3030 
    31 #ifdef USE_OPENAL_DLOPEN 
     31#if USE_OPENAL_DLOPEN 
    3232 
    3333#include "../sys/sys_loadlib.h" 
  • src/client/qal.h

    r118 r0  
    3030#include "../qcommon/qcommon.h" 
    3131 
    32 #ifdef USE_OPENAL_DLOPEN 
     32#if USE_OPENAL_DLOPEN 
    3333#define AL_NO_PROTOTYPES 
    3434#define ALC_NO_PROTOTYPES 
    3535#endif 
    3636 
    37 #ifdef USE_LOCAL_HEADERS 
     37#if USE_LOCAL_HEADERS 
    3838#include "../AL/al.h" 
    3939#include "../AL/alc.h" 
     
    4949#endif 
    5050 
    51 #ifdef USE_OPENAL_DLOPEN 
     51#if USE_OPENAL_DLOPEN 
    5252extern LPALENABLE qalEnable; 
    5353extern LPALDISABLE qalDisable; 
  • src/client/snd_codec.c

    r118 r0  
    104104        codecs = NULL; 
    105105        S_CodecRegister(&wav_codec); 
    106 #ifdef USE_CODEC_VORBIS 
     106#if USE_CODEC_VORBIS 
    107107        S_CodecRegister(&ogg_codec); 
    108108#endif 
  • src/client/snd_codec_ogg.c

    r118 r0  
    2424 
    2525// OGG support is enabled by this define 
    26 #ifdef USE_CODEC_VORBIS 
     26#if USE_CODEC_VORBIS 
    2727 
    2828// includes for the Q3 sound system 
  • src/client/snd_openal.c

    r118 r0  
    2727#include "client.h" 
    2828 
    29 #ifdef USE_OPENAL 
     29#if USE_OPENAL 
    3030 
    3131#include "qal.h" 
     
    18661866qboolean S_AL_Init( soundInterface_t *si ) 
    18671867{ 
    1868 #ifdef USE_OPENAL 
     1868#if USE_OPENAL 
    18691869 
    18701870        qboolean enumsupport, founddev = qfalse; 
  • src/game/bg_lib.c

    r118 r0  
    2525// compiled for the virtual machine 
    2626 
    27  
    28 #ifdef Q3_VM 
    2927 
    3028#include "../qcommon/q_shared.h" 
     
    7068#endif 
    7169static const char rcsid[] = 
    72   "$Id: bg_lib.c 1003 2007-09-22 20:55:11Z tma $"; 
     70  "$Id: bg_lib.c 965 2007-08-09 13:54:12Z msk $"; 
    7371#endif /* LIBC_SCCS and not lint */ 
     72 
     73// bk001127 - needed for DLL's 
     74#if !defined( Q3_VM ) 
     75typedef int    cmp_t(const void *, const void *); 
     76#endif 
    7477 
    7578static char* med3(char *, char *, char *, cmp_t *); 
     
    213216 
    214217 
     218// this file is excluded from release builds because of intrinsics 
     219 
     220// bk001211 - gcc errors on compiling strcpy:  parse error before `__extension__' 
     221#if defined ( Q3_VM ) 
     222 
    215223size_t strlen( const char *string ) 
    216224{ 
     
    265273} 
    266274 
     275//TA: 
    267276char *strrchr( const char *string, int c ) 
    268277{ 
     
    313322} 
    314323 
     324#endif // bk001211 
     325 
     326#if defined ( Q3_VM ) 
     327 
    315328int tolower( int c ) 
    316329{ 
     
    329342  return c; 
    330343} 
     344 
     345#endif 
    331346 
    332347void *memmove( void *dest, const void *src, size_t count ) 
     
    802817#endif 
    803818 
     819#ifdef Q3_VM 
    804820/* 
    805821=============== 
     
    815831} 
    816832 
     833// bk001127 - guarded this tan replacement 
     834// ld: undefined versioned symbol name tan@@GLIBC_2.0 
    817835double tan( double x ) 
    818836{ 
     
    12991317} 
    13001318 
     1319#endif 
     1320 
    13011321 
    13021322 
     
    13951415  float sign; 
    13961416  float value; 
    1397   int   c = '0'; 
     1417  int   c = '0'; // bk001211 - uninitialized use possible 
    13981418 
    13991419  string = *stringPtr; 
     
    14691489} 
    14701490 
     1491 
     1492#if defined ( Q3_VM ) 
    14711493 
    14721494int atoi( const char *string ) 
     
    19251947      case 'f': 
    19261948        AddFloat( &buf_p, *(double *)arg, width, prec ); 
    1927         arg += 1; // everything is 32 bit 
     1949#ifdef Q3_VM 
     1950        arg += 1; // everything is 32 bit in my compiler 
     1951#else 
     1952        arg += 2; 
     1953#endif 
    19281954        break; 
    19291955 
  • src/game/bg_lib.h

    r118 r0  
    2626 
    2727// This file is NOT included on native builds 
    28 #if !defined( BG_LIB_H ) && defined( Q3_VM ) 
     28#ifndef BG_LIB_H 
    2929#define BG_LIB_H 
    3030 
     
    5555#define LONG_MAX      2147483647L   /* maximum (signed) long value */ 
    5656#define ULONG_MAX     0xffffffffUL  /* maximum unsigned long value */ 
    57  
    58 #define isalnum(c)  (isalpha(c) || isdigit(c)) 
    59 #define isalpha(c)  (isupper(c) || islower(c)) 
    60 #define isascii(c)  ((c) > 0 && (c) <= 0x7f) 
    61 #define iscntrl(c)  (((c) >= 0) && (((c) <= 0x1f) || ((c) == 0x7f))) 
    62 #define isdigit(c)  ((c) >= '0' && (c) <= '9') 
    63 #define isgraph(c)  ((c) != ' ' && isprint(c)) 
    64 #define islower(c)  ((c) >=  'a' && (c) <= 'z') 
    65 #define isprint(c)  ((c) >= ' ' && (c) <= '~') 
    66 #define ispunct(c)  (((c) > ' ' && (c) <= '~') && !isalnum(c)) 
    67 #define isspace(c)  ((c) ==  ' ' || (c) == '\f' || (c) == '\n' || (c) == '\r' || \ 
    68                      (c) == '\t' || (c) == '\v') 
    69 #define isupper(c)  ((c) >=  'A' && (c) <= 'Z') 
    70 #define isxdigit(c) (isxupper(c) || isxlower(c)) 
    71 #define isxlower(c) (isdigit(c) || (c >= 'a' && c <= 'f')) 
    72 #define isxupper(c) (isdigit(c) || (c >= 'A' && c <= 'F'))  
    7357 
    7458// Misc functions 
  • src/game/bg_misc.c

    r122 r1  
    3939    "eggpod",              //char      *buildName; 
    4040    "Egg",                 //char      *humanName; 
    41     "The most basic alien structure. It allows aliens to spawn " 
    42       "and protect the Overmind. Without any of these, the Overmind " 
    43       "is left nearly defenseless and defeat is imminent.", 
    4441    "team_alien_spawn",    //char      *entityName; 
    4542    { "models/buildables/eggpod/eggpod.md3", 0, 0, 0 }, 
     
    7976    "barricade",           //char      *buildName; 
    8077    "Barricade",           //char      *humanName; 
    81     "Used to obstruct corridors and doorways, hindering humans from " 
    82       "threatening the spawns and Overmind.", 
    8378    "team_alien_barricade",//char      *entityName; 
    8479    { "models/buildables/barricade/barricade.md3", 0, 0, 0 }, 
     
    118113    "booster",             //char      *buildName; 
    119114    "Booster",             //char      *humanName; 
    120     "Provides any alien with a poison ability on all its " 
    121       "attacks. In addition to the default attack damage, the victim loses " 
    122       "health over time unless they heal themselves with a medkit." 
    123       "The booster also increases the rate of health regeneration for " 
    124       "any nearby aliens.", 
    125115    "team_alien_booster",  //char      *entityName; 
    126116    { "models/buildables/booster/booster.md3", 0, 0, 0 }, 
     
    160150    "acid_tube",           //char      *buildName; 
    161151    "Acid Tube",           //char      *humanName; 
    162     "Ejects lethal poisonous acid at an approaching human. These " 
    163       "are highly effective when used in conjunction with a trapper " 
    164       "to hold the victim in place.", 
    165152    "team_alien_acid_tube",//char      *entityName; 
    166153    { "models/buildables/acid_tube/acid_tube.md3", 0, 0, 0 }, 
     
    200187    "hive",                //char      *buildName; 
    201188    "Hive",                //char      *humanName; 
    202     "Houses millions of tiny insectoid aliens. When a human " 
    203       "approaches this structure, the insectoids attack.", 
    204189    "team_alien_hive",     //char      *entityName; 
    205190    { "models/buildables/acid_tube/acid_tube.md3", 0, 0, 0 }, 
     
    239224    "trapper",             //char      *buildName; 
    240225    "Trapper",             //char      *humanName; 
    241     "Fires a blob of adhesive spit at any non-alien in its line of " 
    242       "sight. This hinders their movement, making them an easy target " 
    243       "for other defensive structures or aliens.", 
    244226    "team_alien_trapper",  //char      *entityName; 
    245227    { "models/buildables/trapper/trapper.md3", 0, 0, 0 }, 
     
    279261    "overmind",            //char      *buildName; 
    280262    "Overmind",            //char      *humanName; 
    281     "A collective consciousness that controls all the alien structures " 
    282       "in its vicinity. It must be protected at all costs, since its " 
    283       "death will render alien structures defenseless.", 
    284263    "team_alien_overmind", //char      *entityName; 
    285264    { "models/buildables/overmind/overmind.md3", 0, 0, 0 }, 
     
    319298    "hovel",               //char      *buildName; 
    320299    "Hovel",               //char      *humanName; 
    321     "An armoured shell used by the builder class to hide in, while " 
    322       "the alien base is under attack. It may be entered or " 
    323       "exited at any time.", 
    324300    "team_alien_hovel",    //char      *entityName; 
    325301    { "models/buildables/hovel/hovel.md3", 0, 0, 0 }, 
     
    359335    "telenode",            //char      *buildName; 
    360336    "Telenode",            //char      *humanName; 
    361     "The most basic human structure. It provides a means for humans " 
    362       "to enter the battle arena. Without any of these the humans " 
    363       "cannot spawn and defeat is imminent.", 
    364337    "team_human_spawn",    //char      *entityName; 
    365338    { "models/buildables/telenode/telenode.md3", 0, 0, 0 }, 
     
    399372    "medistat",            //char      *buildName; 
    400373    "Medistation",         //char      *humanName; 
    401     "A structure providing an automated healing energy that restores " 
    402       "the health of any human that stands inside it. It may only be used " 
    403       "by one person at a time.", 
    404374    "team_human_medistat", //char      *entityName; 
    405375    { "models/buildables/medistat/medistat.md3", 0, 0, 0 }, 
     
    439409    "mgturret",            //char      *buildName; 
    440410    "Machinegun Turret",   //char      *humanName; 
    441     "Automated base defense that is effective against fast moving targets, " 
    442       "but does not cause much damage on its own and should always be " 
    443       "backed up by physical support.", 
    444411    "team_human_mgturret", //char      *entityName; 
    445412    { "models/buildables/mgturret/turret_base.md3", 
     
    481448    "tesla",               //char      *buildName; 
    482449    "Tesla Generator",     //char      *humanName; 
    483     "A structure equipped with a strong electrical attack that always " 
    484       "hits its target. It is useful against larger aliens " 
    485       "and for consolidating basic defense.", 
    486450    "team_human_tesla",    //char      *entityName; 
    487451    { "models/buildables/tesla/tesla.md3", 0, 0, 0 }, 
     
    521485    "dcc",                 //char      *buildName; 
    522486    "Defence Computer",    //char      *humanName; 
    523     "A structure coordinating the action of base defense so that " 
    524       "defense is distributed evenly among the enemy. This structure " 
    525       "is required for building the Tesla Generator.", 
    526487    "team_human_dcc",      //char      *entityName; 
    527488    { "models/buildables/dcc/dcc.md3", 0, 0, 0 }, 
     
    561522    "arm",                 //char      *buildName; 
    562523    "Armoury",             //char      *humanName; 
    563     "An essential part of the human base, providing a means " 
    564       "to upgrade the basic human. A range of upgrades and weapons are " 
    565       "available from the armoury, each with a price.", 
    566524    "team_human_armoury",  //char      *entityName; 
    567525    { "models/buildables/arm/arm.md3", 0, 0, 0 }, 
     
    601559    "reactor",             //char      *buildName; 
    602560    "Reactor",             //char      *humanName; 
    603     "All structures except the telenode rely on a reactor to operate." 
    604       "The reactor provides power for all the human structures either " 
    605       "directly or via repeaters. There can only be a single reactor.", 
    606561    "team_human_reactor",  //char      *entityName; 
    607562    { "models/buildables/reactor/reactor.md3", 0, 0, 0 }, 
     
    641596    "repeater",            //char      *buildName; 
    642597    "Repeater",            //char      *humanName; 
    643     "A power distributor that transmits power from the reactor " 
    644       "to remote locations, so that bases may be built far " 
    645       "from the reactor.", 
    646598    "team_human_repeater", //char      *entityName; 
    647599    { "models/buildables/repeater/repeater.md3", 0, 0, 0 }, 
     
    762714/* 
    763715============== 
    764 BG_FindInfoForBuildable 
    765 ============== 
    766 */ 
    767 char *BG_FindInfoForBuildable( int bclass ) 
    768 { 
    769   int i; 
    770  
    771   for( i = 0; i < bg_numBuildables; i++ ) 
    772   { 
    773     if( bg_buildableList[ i ].buildNum == bclass ) 
    774       return bg_buildableList[ i ].info; 
    775   } 
    776  
    777   //wimp out 
    778   return 0; 
    779 } 
    780  
    781 /* 
    782 ============== 
    783716BG_FindEntityNameForBuildNum 
    784717============== 
     
    15981531    "spectator",                                    //char    *className; 
    15991532    "Spectator",                                    //char    *humanName; 
    1600     "", 
    16011533    "",                                             //char    *modelname; 
    16021534    1.0f,                                           //float   modelScale; 
     
    16371569    "builder",                                      //char    *className; 
    16381570    "Builder",                                      //char    *humanName; 
    1639     "Responsible for building and maintaining all the alien structures.", 
    16401571    "builder",                                      //char    *modelname; 
    16411572    1.0f,                                           //float   modelScale; 
     
    16761607    "builderupg",                                   //char    *classname; 
    16771608    "Advanced Builder",                             //char    *humanname; 
    1678     "Similar to the base Granger, except that in addition to " 
    1679       "being able to build structures it has a melee attack " 
    1680       "and the ability to crawl on walls.", 
    16811609    "builder",                                      //char    *modelname; 
    16821610    1.0f,                                           //float   modelScale; 
     
    17171645    "level0",                                       //char    *classname; 
    17181646    "Soldier",                                      //char    *humanname; 
    1719     "Has a lethal bite and the ability to crawl on walls and ceilings.", 
    17201647    "jumper",                                       //char    *modelname; 
    17211648    0.2f,                                           //float   modelScale; 
     
    17571684    "level1",                                       //char    *classname; 
    17581685    "Hydra",                                        //char    *humanname; 
    1759     "Able to crawl on walls and ceilings. Its melee attack is most " 
    1760       "effective when combined with the ability to grab its foe.", 
    17611686    "spitter",                                      //char    *modelname; 
    17621687    0.6f,                                           //float   modelScale; 
     
    17981723    "level1upg",                                    //char    *classname; 
    17991724    "Hydra Upgrade",                                //char    *humanname; 
    1800     "In addition to the basic Basilisk abilities, the Advanced " 
    1801       "Basilisk sprays a poisonous gas which disorientaits any " 
    1802       "nearby humans.", 
    18031725    "spitter",                                      //char    *modelname; 
    18041726    0.7f,                                           //float   modelScale; 
     
    18401762    "level2",                                       //char    *classname; 
    18411763    "Chimera",                                      //char    *humanname; 
    1842     "Has a melee attack and the ability to jump off walls. This " 
    1843       "allows the Marauder to gather great speed in enclosed areas.", 
    18441764    "tarantula",                                    //char    *modelname; 
    18451765    0.75f,                                          //float   modelScale; 
     
    18811801    "level2upg",                                    //char    *classname; 
    18821802    "Chimera Upgrade",                              //char    *humanname; 
    1883     "The Advanced Marauder has all the abilities of the base Marauder " 
    1884       "including an area effect electric shock attack.", 
    18851803    "tarantula",                                    //char    *modelname; 
    18861804    0.9f,                                           //float   modelScale; 
     
    19221840    "level3",                                       //char    *classname; 
    19231841    "Dragoon",                                      //char    *humanname; 
    1924     "Possesses a melee attack and the pounce ability, which may " 
    1925       "be used as an attack, or a means to reach a remote " 
    1926       "location inaccessible from the ground.", 
    19271842    "prowl",                                        //char    *modelname; 
    19281843    1.0f,                                           //float   modelScale; 
     
    19641879    "level3upg",                                    //char    *classname; 
    19651880    "Dragoon Upgrade",                              //char    *humanname; 
    1966     "In addition to the basic Dragoon abilities, the Dragoon " 
    1967       "Upgrade has 3 barbs which may be used to attack humans " 
    1968       "from a distance.", 
    19691881    "prowl",                                        //char    *modelname; 
    19701882    1.0f,                                           //float   modelScale; 
     
    20061918    "level4",                                       //char    *classname; 
    20071919    "Big Mofo",                                     //char    *humanname; 
    2008     "Provides a healing aura in which nearby aliens regenerate health " 
    2009       "faster than usual. As well as a melee attack, this class can charge " 
    2010       "at enemy humans and structures, inflicting great damage.", 
    20111920    "mofo",                                         //char    *modelname; 
    20121921    1.0f,                                           //float   modelScale; 
     
    20481957    "human_base",                                   //char    *classname; 
    20491958    "Human",                                        //char    *humanname; 
    2050     "", 
    20511959    "sarge",                                        //char    *modelname; 
    20521960    1.0f,                                           //float   modelScale; 
     
    20851993  }, 
    20861994  { 
    2087     PCL_HUMAN_BSUIT,                                //int     classnum; 
    2088     "human_bsuit",                                  //char    *classname; 
    2089     "Battlesuit",                                   //char    *humanname; 
    2090     "", 
    2091     "keel",                                         //char    *modelname; 
    2092     1.0f,                                           //float   modelScale; 
    2093     "default",                                      //char    *skinname; 
    2094     1.0f,                                           //float   shadowScale; 
    2095     "human_hud",                                    //char    *hudname; 
    2096     ( 1 << S3 ),                                    //int  stages 
    2097     { -15, -15, -38 },                              //vec3_t  mins; 
    2098     { 15, 15, 38 },                                 //vec3_t  maxs; 
    2099     { 15, 15, 38 },                                 //vec3_t  crouchmaxs; 
    2100     { -15, -15, -4 },                               //vec3_t  deadmins; 
    2101     { 15, 15, 4 },                                  //vec3_t  deadmaxs; 
    2102     -16.0f,                                           //float   zOffset 
    2103     35, 35,                                         //int     viewheight, crouchviewheight; 
    2104     100,                                            //int     health; 
    2105     1.0f,                                           //float   fallDamage; 
    2106     0,                                              //int     regenRate; 
    2107     SCA_TAKESFALLDAMAGE| 
    2108       SCA_CANUSELADDERS,                            //int     abilities; 
    2109     WP_NONE, //special-cased in g_client.c          //weapon_t  startWeapon 
    2110     110.0f,                                         //float   buildDist; 
    2111     90,                                             //int     fov; 
    2112     0.002f,                                         //float   bob; 
    2113     1.0f,                                           //float   bobCycle; 
    2114     100,                                            //int     steptime; 
    2115     1.0f,                                           //float   speed; 
    2116     10.0f,                                          //float   acceleration; 
    2117     1.0f,                                           //float   airAcceleration; 
    2118     6.0f,                                           //float   friction; 
    2119     100.0f,                                         //float   stopSpeed; 
    2120     270.0f,                                         //float   jumpMagnitude; 
    2121     1.0f,                                           //float   knockbackScale; 
    2122     { PCL_NONE, PCL_NONE, PCL_NONE },               //int     children[ 3 ]; 
    2123     0,                                              //int     cost; 
    2124     0                                               //int     value; 
    2125   }, 
     1995    //this isn't a real class, but a dummy to force the client to precache the model 
     1996    //FIXME: one day do this in a less hacky fashion 
     1997    PCL_HUMAN_BSUIT, "human_bsuit", "bsuit", 
     1998 
     1999    "keel", 
     2000    1.0f, 
     2001    "default", 
     2002    1.0f, 
     2003 
     2004    "bsuit", ( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), { 0, 0, 0 }, { 0, 0, 0, }, 
     2005    { 0, 0, 0, }, { 0, 0, 0, }, { 0, 0, 0, }, 0.0f, 0, 0, 0, 0.0f, 0, 0, WP_NONE, 0.0f, 0, 
     2006    0.0f, 1.0f, 0, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 270.0f, 1.0f, { PCL_NONE, PCL_NONE, PCL_NONE }, 0, 0 
     2007  } 
    21262008}; 
    21272009 
     
    21892071 
    21902072  Com_Printf( S_COLOR_YELLOW "WARNING: fallthrough in BG_FindHumanNameForClassNum\n" ); 
    2191   //wimp out 
    2192   return 0; 
    2193 } 
    2194  
    2195 /* 
    2196 ============== 
    2197 BG_FindInfoForClassNum 
    2198 ============== 
    2199 */ 
    2200 char *BG_FindInfoForClassNum( int pclass ) 
    2201 { 
    2202   int i; 
    2203  
    2204   for( i = 0; i < bg_numPclasses; i++ ) 
    2205   { 
    2206     if( bg_classList[ i ].classNum == pclass ) 
    2207       return bg_classList[ i ].info; 
    2208   } 
    2209  
    2210   Com_Printf( S_COLOR_YELLOW "WARNING: fallthrough in BG_FindInfoForClassNum\n" ); 
    22112073  //wimp out 
    22122074  return 0; 
     
    31893051    "blaster",            //char      *weaponName; 
    31903052    "Blaster",            //char      *weaponHumanName; 
    3191     "", 
    31923053    0,                    //int       maxAmmo; 
    31933054    0,                    //int       maxClips; 
     
    32153076    "rifle",              //char      *weaponName; 
    32163077    "Rifle",              //char      *weaponHumanName; 
    3217     "Basic weapon. Cased projectile weapon, with a slow clip based " 
    3218       "reload system.", 
    32193078    RIFLE_CLIPSIZE,       //int       maxAmmo; 
    32203079    RIFLE_MAXCLIPS,       //int       maxClips; 
     
    32423101    "shotgun",            //char      *weaponName; 
    32433102    "Shotgun",            //char      *weaponHumanName; 
    3244     "Close range weapon that is useful against larger foes. " 
    3245       "It has a slow repeat rate, but can be devastatingly " 
    3246       "effective.", 
    32473103    SHOTGUN_SHELLS,       //int       maxAmmo; 
    32483104    SHOTGUN_MAXCLIPS,     //int       maxClips; 
     
    32703126    "flamer",             //char      *weaponName; 
    32713127    "Flame Thrower",      //char      *weaponHumanName; 
    3272     "Sprays fire at its target. It is powered by compressed " 
    3273       "gas. The relatively low rate of fire means this weapon is most " 
    3274       "effective against static targets.", 
    32753128    FLAMER_GAS,           //int       maxAmmo; 
    32763129    0,                    //int       maxClips; 
     
    32983151    "chaingun",           //char      *weaponName; 
    32993152    "Chaingun",           //char      *weaponHumanName; 
    3300     "Belt drive, cased projectile weapon. It has a high repeat " 
    3301       "rate but a wide firing angle and is therefore relatively " 
    3302       "inaccurate.", 
    33033153    CHAINGUN_BULLETS,     //int       maxAmmo; 
    33043154    0,                    //int       maxClips; 
     
    33263176    "mdriver",            //char      *weaponName; 
    33273177    "Mass Driver",        //char      *weaponHumanName; 
    3328     "A portable particle accelerator which causes minor nuclear " 
    3329       "reactions at the point of impact. It has a very large " 
    3330       "payload, but fires slowly.", 
    33313178    MDRIVER_CLIPSIZE,     //int       maxAmmo; 
    33323179    MDRIVER_MAXCLIPS,     //int       maxClips; 
     
    33543201    "prifle",             //char      *weaponName; 
    33553202    "Pulse Rifle",        //char      *weaponHumanName; 
    3356     "An energy weapon that fires pulses of concentrated energy " 
    3357       "at a fast rate. It requires re-energising every 50 pulses.", 
    33583203    PRIFLE_CLIPS,         //int       maxAmmo; 
    33593204    PRIFLE_MAXCLIPS,      //int       maxClips; 
     
    33813226    "lcannon",            //char      *weaponName; 
    33823227    "Lucifer Cannon",     //char      *weaponHumanName; 
    3383     "Similar to the pulse rifle, but more powerful. Additionally, " 
    3384       "it has a secondary attack where energy can be charged " 
    3385       "up to shoot a devastating ball of energy.", 
    33863228    LCANNON_AMMO,         //int       maxAmmo; 
    33873229    0,                    //int       maxClips; 
     
    34093251    "lgun",               //char      *weaponName; 
    34103252    "Las Gun",            //char      *weaponHumanName; 
    3411     "Slightly more powerful than the basic rifle, but " 
    3412       "instead of bullets it fires small packets of energy.", 
    34133253    LASGUN_AMMO,          //int       maxAmmo; 
    34143254    0,                    //int       maxClips; 
     
    34363276    "psaw",               //char      *weaponName; 
    34373277    "Pain Saw",           //char      *weaponHumanName; 
    3438     "Similar to a chainsaw, but instead of a chain it has an " 
    3439       "electric arc capable of dealing a great deal of damage at " 
    3440       "close range.", 
    34413278    0,                    //int       maxAmmo; 
    34423279    0,                    //int       maxClips; 
     
    34643301    "grenade",            //char      *weaponName; 
    34653302    "Grenade",            //char      *weaponHumanName; 
    3466     "", 
    34673303    1,                    //int       maxAmmo; 
    34683304    0,                    //int       maxClips; 
     
    34903326    "ckit",               //char      *weaponName; 
    34913327    "Construction Kit",   //char      *weaponHumanName; 
    3492     "Used for building all basic structures. This includes " 
    3493       "spawns, power and basic defense.", 
    34943328    0,                    //int       maxAmmo; 
    34953329    0,                    //int       maxClips; 
     
    35173351    "ackit",              //char      *weaponName; 
    35183352    "Adv Construction Kit",//char      *weaponHumanName; 
    3519     "Used for building advanced structures. This includes " 
    3520       "combat computers and advanced defense.", 
    35213353    0,                    //int       maxAmmo; 
    35223354    0,                    //int       maxClips; 
     
    35443376    "abuild",             //char      *weaponName; 
    35453377    "Alien build weapon", //char      *weaponHumanName; 
    3546     "", 
    35473378    0,                    //int       maxAmmo; 
    35483379    0,                    //int       maxClips; 
     
    35703401    "abuildupg",          //char      *weaponName; 
    35713402    "Alien build weapon2",//char      *weaponHumanName; 
    3572     "", 
    35733403    0,                    //int       maxAmmo; 
    35743404    0,                    //int       maxClips; 
     
    35963426    "level0",             //char      *weaponName; 
    35973427    "Bite",               //char      *weaponHumanName; 
    3598     "", 
    35993428    0,                    //int       maxAmmo; 
    36003429    0,                    //int       maxClips; 
     
    36223451    "level1",             //char      *weaponName; 
    36233452    "Claws",              //char      *weaponHumanName; 
    3624     "", 
    36253453    0,                    //int       maxAmmo; 
    36263454    0,                    //int       maxClips; 
     
    36483476    "level1upg",          //char      *weaponName; 
    36493477    "Claws Upgrade",      //char      *weaponHumanName; 
    3650     "", 
    36513478    0,                    //int       maxAmmo; 
    36523479    0,                    //int       maxClips; 
     
    36743501    "level2",             //char      *weaponName; 
    36753502    "Bite",               //char      *weaponHumanName; 
    3676     "", 
    36773503    0,                    //int       maxAmmo; 
    36783504    0,                    //int       maxClips; 
     
    37003526    "level2upg",          //char      *weaponName; 
    37013527    "Zap",                //char      *weaponHumanName; 
    3702     "", 
    37033528    0,                    //int       maxAmmo; 
    37043529    0,                    //int       maxClips; 
     
    37263551    "level3",             //char      *weaponName; 
    37273552    "Pounce",             //char      *weaponHumanName; 
    3728     "", 
    37293553    0,                    //int       maxAmmo; 
    37303554    0,                    //int       maxClips; 
     
    37523576    "level3upg",          //char      *weaponName; 
    37533577    "Pounce (upgrade)",   //char      *weaponHumanName; 
    3754     "", 
    37553578    3,                    //int       maxAmmo; 
    37563579    0,                    //int       maxClips; 
     
    37783601    "level4",             //char      *weaponName; 
    37793602    "Charge",             //char      *weaponHumanName; 
    3780     "", 
    37813603    0,                    //int       maxAmmo; 
    37823604    0,                    //int       maxClips; 
     
    38043626    "lockblob",           //char      *weaponName; 
    38053627    "Lock Blob",          //char      *weaponHumanName; 
    3806     "", 
    38073628    0,                    //int       maxAmmo; 
    38083629    0,                    //int       maxClips; 
     
    38303651    "hive",               //char      *weaponName; 
    38313652    "Hive",               //char      *weaponHumanName; 
    3832     "", 
    38333653    0,                    //int       maxAmmo; 
    38343654    0,                    //int       maxClips; 
     
    38563676    "mgturret",           //char      *weaponName; 
    38573677    "Machinegun Turret",  //char      *weaponHumanName; 
    3858     "", 
    38593678    0,                    //int       maxAmmo; 
    38603679    0,                    //int       maxClips; 
     
    38823701    "teslagen",           //char      *weaponName; 
    38833702    "Tesla Generator",    //char      *weaponHumanName; 
    3884     "", 
    38853703    0,                    //int       maxAmmo; 
    38863704    0,                    //int       maxClips; 
     
    40273845/* 
    40283846============== 
    4029 BG_FindInfoForWeapon 
    4030 ============== 
    4031 */ 
    4032 char *BG_FindInfoForWeapon( int weapon ) 
    4033 { 
    4034   int i; 
    4035  
    4036   for( i = 0; i < bg_numWeapons; i++ ) 
    4037   { 
    4038     if( bg_weapons[ i ].weaponNum == weapon ) 
    4039       return bg_weapons[ i ].info; 
    4040   } 
    4041  
    4042   //wimp out 
    4043   return 0; 
    4044 } 
    4045  
    4046 /* 
    4047 ============== 
    40483847BG_FindAmmoForWeapon 
    40493848============== 
     
    43734172    "larmour",              //char  *upgradeName; 
    43744173    "Light Armour",         //char  *upgradeHumanName; 
    4375     "Protective armour that helps to defend against light alien melee " 
    4376       "attacks.", 
    43774174    "icons/iconu_larmour", 
    43784175    qtrue,                  //qboolean purchasable 
     
    43874184    "helmet",               //char  *upgradeName; 
    43884185    "Helmet",               //char  *upgradeHumanName; 
    4389     "In addition to protecting your head, the helmet provides a " 
    4390       "scanner indicating the presence of any non-human lifeforms in your " 
    4391       "immediate vicinity.", 
    43924186    "icons/iconu_helmet", 
    43934187    qtrue,                  //qboolean purchasable 
     
    44024196    "medkit",               //char  *upgradeName; 
    44034197    "Medkit",               //char  *upgradeHumanName; 
    4404     "", 
    44054198    "icons/iconu_atoxin", 
    44064199    qfalse,                 //qboolean purchasable 
     
    44154208    "battpack",             //char  *upgradeName; 
    44164209    "Battery Pack",         //char  *upgradeHumanName; 
    4417     "Back-mounted battery pack that permits storage of one and a half " 
    4418       "times the normal energy capacity for energy weapons.", 
    44194210    "icons/iconu_battpack", 
    44204211    qtrue,                  //qboolean purchasable 
     
    44294220    "jetpack",              //char  *upgradeName; 
    44304221    "Jet Pack",             //char  *upgradeHumanName; 
    4431     "Back-mounted jet pack that enables the user to fly to remote " 
    4432       "locations. It is very useful against alien spawns in hard " 
    4433       "to reach spots.", 
    44344222    "icons/iconu_jetpack", 
    44354223    qtrue,                  //qboolean purchasable 
     
    44444232    "bsuit",                //char  *upgradeName; 
    44454233    "Battlesuit",           //char  *upgradeHumanName; 
    4446     "A full body armour that is highly effective at repelling alien attacks. " 
    4447       "It allows the user to enter hostile situations with a greater degree " 
    4448       "of confidence.", 
    44494234    "icons/iconu_bsuit", 
    44504235    qtrue,                  //qboolean purchasable 
     
    44594244    "gren",                 //char  *upgradeName; 
    44604245    "Grenade",              //char  *upgradeHumanName; 
    4461     "A small incendinary device ideal for damaging tightly packed " 
    4462       "alien structures. Has a five second timer.", 
    44634246    0, 
    44644247    qtrue,                  //qboolean purchasable 
     
    44734256    "ammo",                 //char  *upgradeName; 
    44744257    "Ammunition",           //char  *upgradeHumanName; 
    4475     "Ammunition for the currently held weapon.", 
    44764258    0, 
    44774259    qtrue,                  //qboolean purchasable 
     
    45974379    if( bg_upgrades[ i ].upgradeNum == upgrade ) 
    45984380      return bg_upgrades[ i ].upgradeHumanName; 
    4599   } 
    4600  
    4601   //wimp out 
    4602   return 0; 
    4603 } 
    4604  
    4605 /* 
    4606 ============== 
    4607 BG_FindInfoForUpgrade 
    4608 ============== 
    4609 */ 
    4610 char *BG_FindInfoForUpgrade( int upgrade ) 
    4611 { 
    4612   int i; 
    4613  
    4614   for( i = 0; i < bg_numUpgrades; i++ ) 
    4615   { 
    4616     if( bg_upgrades[ i ].upgradeNum == upgrade ) 
    4617       return bg_upgrades[ i ].info; 
    46184381  } 
    46194382 
     
    48524615  "EV_FIRE_WEAPON3", 
    48534616 
    4854   "EV_PLAYER_RESPAWN", // for fovwarp effects 
     4617  "EV_PLAYER_RESPAWN", //TA: for fovwarp effects 
    48554618  "EV_PLAYER_TELEPORT_IN", 
    48564619  "EV_PLAYER_TELEPORT_OUT", 
     
    48844647  "EV_GIB_PLAYER",      // gib a previously living player 
    48854648 
    4886   "EV_BUILD_CONSTRUCT", 
    4887   "EV_BUILD_DESTROY", 
    4888   "EV_BUILD_DELAY",     // can't build yet 
    4889   "EV_BUILD_REPAIR",    // repairing buildable 
    4890   "EV_BUILD_REPAIRED",  // buildable has full health 
     4649  "EV_BUILD_CONSTRUCT", //TA 
     4650  "EV_BUILD_DESTROY",   //TA 
     4651  "EV_BUILD_DELAY",     //TA: can't build yet 
     4652  "EV_BUILD_REPAIR",    //TA: repairing buildable 
     4653  "EV_BUILD_REPAIRED",  //TA: buildable has full health 
    48914654  "EV_HUMAN_BUILDABLE_EXPLOSION", 
    48924655  "EV_ALIEN_BUILDABLE_EXPLOSION", 
     
    49024665  "EV_TAUNT", 
    49034666 
    4904   "EV_OVERMIND_ATTACK", // overmind under attack 
    4905   "EV_OVERMIND_DYING",  // overmind close to death 
    4906   "EV_OVERMIND_SPAWNS", // overmind needs spawns 
    4907  
    4908   "EV_DCC_ATTACK",      // dcc under attack 
    4909  
    4910   "EV_RPTUSE_SOUND"     // trigger a sound 
     4667  "EV_OVERMIND_ATTACK", //TA: overmind under attack 
     4668  "EV_OVERMIND_DYING",  //TA: overmind close to death 
     4669  "EV_OVERMIND_SPAWNS", //TA: overmind needs spawns 
     4670 
     4671  "EV_DCC_ATTACK",      //TA: dcc under attack 
     4672 
     4673  "EV_RPTUSE_SOUND"     //TA: trigger a sound 
    49114674}; 
    49124675 
     
    49824745    SnapVector( s->apos.trBase ); 
    49834746 
     4747  //TA: i need for other things :) 
     4748  //s->angles2[YAW] = ps->movementDir; 
    49844749  s->time2 = ps->movementDir; 
    49854750  s->legsAnim = ps->legsAnim; 
     
    50334798  } 
    50344799 
    5035   // use powerups field to store team/class info: 
     4800  //TA: use powerups field to store team/class info: 
    50364801  s->powerups = ps->stats[ STAT_PTEAM ] | ( ps->stats[ STAT_PCLASS ] << 8 ); 
    50374802 
    5038   // have to get the surfNormal through somehow... 
     4803  //TA: have to get the surfNormal thru somehow... 
    50394804  VectorCopy( ps->grapplePoint, s->angles2 ); 
    50404805  if( ps->stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) 
     
    50904855    SnapVector( s->apos.trBase ); 
    50914856 
     4857  //TA: i need for other things :) 
     4858  //s->angles2[YAW] = ps->movementDir; 
    50924859  s->time2 = ps->movementDir; 
    50934860  s->legsAnim = ps->legsAnim; 
     
    51434910  } 
    51444911 
    5145   // use powerups field to store team/class info: 
     4912  //TA: use powerups field to store team/class info: 
    51464913  s->powerups = ps->stats[ STAT_PTEAM ] | ( ps->stats[ STAT_PCLASS ] << 8 ); 
    51474914 
    5148   // have to get the surfNormal through somehow... 
     4915  //TA: have to get the surfNormal thru somehow... 
    51494916  VectorCopy( ps->grapplePoint, s->angles2 ); 
    51504917  if( ps->stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) 
     
    51624929/* 
    51634930======================== 
    5164 BG_UnpackAmmoArray  
     4931BG_UnpackAmmoArray 
    51654932 
    51664933Extract the ammo quantity from the array 
    51674934======================== 
    51684935*/ 
    5169 void BG_UnpackAmmoArray( int weapon, int psAmmo[ ], int psAmmo2[ ], int *ammo, int *clips )    
     4936void BG_UnpackAmmoArray( int weapon, int psAmmo[ ], int psAmmo2[ ], int *ammo, int *clips ) 
    51704937{ 
    51714938  int   ammoarray[ 32 ]; 
     
    51834950  if( clips != NULL ) 
    51844951    *clips = ( ammoarray[ weapon ] >> 12 ) & 0x0F; 
    5185 }  
    5186      
    5187 /* 
    5188 ========================  
     4952} 
     4953 
     4954/* 
     4955======================== 
    51894956BG_PackAmmoArray 
    51904957 
     
    51934960*/ 
    51944961void BG_PackAmmoArray( int weapon, int psAmmo[ ], int psAmmo2[ ], int ammo, int clips ) 
    5195 {  
     4962{ 
    51964963  int   weaponvalue; 
    5197    
     4964 
    51984965  weaponvalue = ammo | ( clips << 12 ); 
    5199    
     4966 
    52004967  if( weapon <= 15 ) 
    52014968    psAmmo[ weapon ] = weaponvalue; 
    52024969  else if( weapon >= 16 ) 
    52034970    psAmmo2[ weapon - 16 ] = weaponvalue; 
    5204 }      
     4971} 
    52054972 
    52064973/* 
     
    54135180 
    54145181  return qtrue; 
    5415 } 
    5416  
    5417 /* 
    5418 =============== 
    5419 BG_GetClientNormal 
    5420  
    5421 Get the normal for the surface the client is walking on 
    5422 =============== 
    5423 */ 
    5424 void BG_GetClientNormal( const playerState_t *ps, vec3_t normal ) 
    5425 { 
    5426   if( ps->stats[ STAT_STATE ] & SS_WALLCLIMBING ) 
    5427   { 
    5428     if( ps->stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) 
    5429       VectorSet( normal, 0.0f, 0.0f, -1.0f ); 
    5430     else 
    5431       VectorCopy( ps->grapplePoint, normal ); 
    5432   } 
    5433   else 
    5434     VectorSet( normal, 0.0f, 0.0f, 1.0f ); 
    54355182} 
    54365183 
     
    54525199  float   buildDist; 
    54535200 
    5454   BG_GetClientNormal( ps, playerNormal ); 
     5201  if( ps->stats[ STAT_STATE ] & SS_WALLCLIMBING ) 
     5202  { 
     5203    if( ps->stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) 
     5204      VectorSet( playerNormal, 0.0f, 0.0f, -1.0f ); 
     5205    else 
     5206      VectorCopy( ps->grapplePoint, playerNormal ); 
     5207  } 
     5208  else 
     5209    VectorSet( playerNormal, 0.0f, 0.0f, 1.0f ); 
    54555210 
    54565211  VectorCopy( ps->viewangles, angles ); 
     
    54725227  VectorMA( targetOrigin, -128, playerNormal, targetOrigin ); 
    54735228 
    5474   // The mask is MASK_DEADSOLID on purpose to avoid collisions with other entities 
    54755229  (*trace)( tr, entityOrigin, mins, maxs, targetOrigin, ps->clientNum, MASK_DEADSOLID ); 
    54765230  VectorCopy( tr->endpos, entityOrigin ); 
  • src/game/bg_pmove.c

    r122 r1  
    235235  vel = pm->ps->velocity; 
    236236 
    237   // make sure vertical velocity is NOT set to zero when wall climbing 
     237  //TA: make sure vertical velocity is NOT set to zero when wall climbing 
    238238  VectorCopy( vel, vec ); 
    239239  if( pml.walking && !( pm->ps->stats[ STAT_STATE ] & SS_WALLCLIMBING ) ) 
     
    666666static qboolean PM_CheckJump( void ) 
    667667{ 
    668   vec3_t normal; 
    669  
    670668  if( BG_FindJumpMagnitudeForClass( pm->ps->stats[ STAT_PCLASS ] ) == 0.0f ) 
    671669    return qfalse; 
     
    715713  pm->ps->pm_flags |= PMF_JUMP_HELD; 
    716714 
    717   // take some stamina off 
     715  //TA: take some stamina off 
    718716  if( pm->ps->stats[ STAT_PTEAM ] == PTE_HUMANS ) 
    719717    pm->ps->stats[ STAT_STAMINA ] -= 500; 
     
    721719  pm->ps->groundEntityNum = ENTITYNUM_NONE; 
    722720 
    723   // jump away from wall 
    724   BG_GetClientNormal( pm->ps, normal ); 
    725  
    726   VectorMA( pm->ps->velocity, BG_FindJumpMagnitudeForClass( pm->ps->stats[ STAT_PCLASS ] ), 
    727             normal, pm->ps->velocity ); 
     721  //TA: jump away from wall 
     722  if( pm->ps->stats[ STAT_STATE ] & SS_WALLCLIMBING ) 
     723  { 
     724    vec3_t normal = { 0, 0, -1 }; 
     725 
     726    if( !( pm->ps->stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) ) 
     727      VectorCopy( pm->ps->grapplePoint, normal ); 
     728 
     729    VectorMA( pm->ps->velocity, BG_FindJumpMagnitudeForClass( pm->ps->stats[ STAT_PCLASS ] ), 
     730              normal, pm->ps->velocity ); 
     731  } 
     732  else 
     733    pm->ps->velocity[ 2 ] = BG_FindJumpMagnitudeForClass( pm->ps->stats[ STAT_PCLASS ] ); 
    728734 
    729735  PM_AddEvent( EV_JUMP ); 
     
    14701476static int PM_FootstepForSurface( void ) 
    14711477{ 
     1478  //TA: 
    14721479  if( pm->ps->stats[ STAT_STATE ] & SS_CREEPSLOWED ) 
    14731480    return EV_FOOTSTEP_SQUELCH; 
     
    17181725  vec3_t    abc; 
    17191726 
    1720   BG_GetClientNormal( pm->ps, surfNormal ); 
     1727  //TA: If we're on the ceiling then grapplePoint is a rotation normal.. otherwise its a surface normal. 
     1728  //    would have been nice if Carmack had left a few random variables in the ps struct for mod makers 
     1729  if( pm->ps->stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) 
     1730    VectorCopy( ceilingNormal, surfNormal ); 
     1731  else 
     1732    VectorCopy( pm->ps->grapplePoint, surfNormal ); 
    17211733 
    17221734  //construct a vector which reflects the direction the player is looking wrt the surface normal 
     
    22762288  BG_FindViewheightForClass( pm->ps->stats[ STAT_PCLASS ], &PCvh, &PCcvh ); 
    22772289 
     2290  //TA: iD bug? you can still crouch when you're a spectator 
    22782291  if( pm->ps->persistant[ PERS_TEAM ] == TEAM_SPECTATOR ) 
    22792292    PCcvh = PCvh; 
     
    22942307  } 
    22952308 
    2296   // If the standing and crouching viewheights are the same the class can't crouch 
     2309  //TA: If the standing and crouching viewheights are the same the class can't crouch 
    22972310  if( ( pm->cmd.upmove < 0 ) && ( PCvh != PCcvh ) && 
    22982311      pm->ps->pm_type != PM_JETPACK && 
     
    23492362  if( BG_ClassHasAbility( pm->ps->stats[ STAT_PCLASS ], SCA_WALLCLIMBER ) && ( pml.groundPlane ) ) 
    23502363  { 
    2351     // FIXME: yes yes i know this is wrong 
     2364    //TA: FIXME: yes yes i know this is wrong 
    23522365    pm->xyspeed = sqrt( pm->ps->velocity[ 0 ] * pm->ps->velocity[ 0 ] 
    23532366                      + pm->ps->velocity[ 1 ] * pm->ps->velocity[ 1 ] 
     
    27102723  if( pm->ps->weaponTime <= 0 || pm->ps->weaponstate != WEAPON_FIRING ) 
    27112724  { 
    2712     // must press use to switch weapons 
     2725    //TA: must press use to switch weapons 
    27132726    if( pm->cmd.buttons & BUTTON_USE_HOLDABLE ) 
    27142727    { 
     
    27732786  // start the animation even if out of ammo 
    27742787 
    2775   BG_UnpackAmmoArray( pm->ps->weapon, pm->ps->ammo, pm->ps->powerups, &ammo, &clips); 
     2788  BG_UnpackAmmoArray( pm->ps->weapon, pm->ps->ammo, pm->ps->powerups, &ammo, &clips ); 
    27762789  BG_FindAmmoForWeapon( pm->ps->weapon, NULL, &maxClips ); 
    27772790 
     
    28592872      attack1 = pm->cmd.buttons & BUTTON_ATTACK; 
    28602873      attack2 = pm->cmd.buttons & BUTTON_ATTACK2; 
    2861       attack3 = qfalse; 
    2862  
    2863       if( attack1 ) 
     2874      attack3 = pm->cmd.buttons & BUTTON_USE_HOLDABLE; 
     2875 
     2876      if( ( attack1 || pm->ps->stats[ STAT_MISC ] == 0 ) && !attack2 && !attack3 ) 
    28642877      { 
    2865         attack2 = qfalse; 
    2866  
    28672878        if( pm->ps->stats[ STAT_MISC ] < LCANNON_TOTAL_CHARGE ) 
    28682879        { 
    2869           // Charging 
    28702880          pm->ps->weaponTime = 0; 
    28712881          pm->ps->weaponstate = WEAPON_READY; 
    28722882          return; 
    28732883        } 
     2884        else 
     2885          attack1 = !attack1; 
    28742886      } 
    28752887 
     2888      //erp this looks confusing 
    28762889      if( pm->ps->stats[ STAT_MISC ] > LCANNON_MIN_CHARGE ) 
    2877       { 
    2878         // Fire primary attack 
    2879         attack1 = qtrue; 
    2880         attack2 = qfalse; 
    2881       } 
     2890        attack1 = !attack1; 
    28822891      else if( pm->ps->stats[ STAT_MISC ] > 0 ) 
    28832892      { 
    2884         // Not enough charge 
    28852893        pm->ps->stats[ STAT_MISC ] = 0; 
    2886         pm->ps->weaponTime = 0; 
    2887         pm->ps->weaponstate = WEAPON_READY; 
    2888         return; 
    2889       } 
    2890       else if( !attack2 ) 
    2891       { 
    2892         // Idle 
    28932894        pm->ps->weaponTime = 0; 
    28942895        pm->ps->weaponstate = WEAPON_READY; 
     
    29242925  } 
    29252926 
    2926   // fire events for non auto weapons 
     2927  //TA: fire events for non auto weapons 
    29272928  if( attack3 ) 
    29282929  { 
     
    29722973  } 
    29732974 
    2974   // fire events for autohit weapons 
     2975  //TA: fire events for autohit weapons 
    29752976  if( pm->autoWeaponHit[ pm->ps->weapon ] ) 
    29762977  { 
     
    30493050  if( !BG_FindInfinteAmmoForWeapon( pm->ps->weapon ) ) 
    30503051  { 
    3051     //special case for lcannon 
     3052    //special case for lCanon 
    30523053    if( pm->ps->weapon == WP_LUCIFER_CANNON && attack1 && !attack2 ) 
    30533054    { 
     
    32173218  for( i = 0; i < 3; i++ ) 
    32183219  { 
    3219     while( tempang[ i ] > 180.0f ) 
    3220       tempang[ i ] -= 360.0f; 
    3221  
    3222     while( tempang[ i ] < -180.0f ) 
    3223       tempang[ i ] += 360.0f; 
     3220    while( tempang[ i ] > 180 ) 
     3221      tempang[ i ] -= 360; 
     3222 
     3223    while( tempang[ i ] < 180 ) 
     3224      tempang[ i ] += 360; 
    32243225  } 
    32253226 
     
    32703271{ 
    32713272  int ammo, clips; 
     3273 
    32723274  pm = pmove; 
    32733275 
     
    34363438    if( BG_ClassHasAbility( pm->ps->stats[ STAT_PCLASS ], SCA_WALLCLIMBER ) && 
    34373439        ( pm->ps->stats[ STAT_STATE ] & SS_WALLCLIMBING ) ) 
    3438       PM_ClimbMove( ); // walking on any surface 
     3440      PM_ClimbMove( ); //TA: walking on any surface 
    34393441    else 
    34403442      PM_WalkMove( ); // walking on ground 
     
    34473449  // set groundentity, watertype, and waterlevel 
    34483450  PM_GroundTrace( ); 
    3449  
     3451  //TA: must update after every GroundTrace() - yet more clock cycles down the drain :( (14 vec rotations/frame) 
    34503452  // update the viewangles 
    34513453  PM_UpdateViewAngles( pm->ps, &pm->cmd ); 
     
    35183520  } 
    35193521} 
     3522 
     3523/* 
     3524================ 
     3525 PmovePredict 
     3526 
     3527 Used by the server to move a client along when they miss a server frame 
     3528================ 
     3529*/ 
     3530 
     3531void PmovePredict( pmove_t *pmove, float frametime ) 
     3532{ 
     3533  pm = pmove; 
     3534  memset( &pml, 0, sizeof( pml ) ); 
     3535  pml.frametime = frametime; 
     3536  PM_GroundTrace( ); 
     3537  if( pml.groundPlane ) 
     3538    PM_StepSlideMove( qfalse, qtrue ); 
     3539  else 
     3540    PM_StepSlideMove( qtrue, qtrue ); 
     3541} 
  • src/game/bg_public.h

    r122 r1  
    4040#define DEFAULT_VIEWHEIGHT      26 
    4141#define CROUCH_VIEWHEIGHT       12 
    42 #define DEAD_VIEWHEIGHT         -14 // watch for mins[ 2 ] less than this causing 
     42#define DEAD_VIEWHEIGHT         -14 //TA: watch for mins[ 2 ] less than this causing 
    4343 
    4444// 
     
    7070#define CS_SHADERSTATE      24 
    7171#define CS_BOTINFO          25 
    72 #define CS_CLIENTS_READY    26 
    73  
     72#define CS_CLIENTS_READY    26    //TA: following suggestion in STAT_ enum STAT_CLIENTS_READY becomes a configstring 
     73 
     74//TA: extra stuff: 
    7475#define CS_BUILDPOINTS      28 
    7576#define CS_STAGES           29 
     
    141142#define PMF_RESPAWNED       512     // clear after attack and jump buttons come up 
    142143#define PMF_USE_ITEM_HELD   1024 
    143 #define PMF_WEAPON_RELOAD   2048    // force a weapon switch 
     144#define PMF_WEAPON_RELOAD   2048    //TA: force a weapon switch 
    144145#define PMF_FOLLOW          4096    // spectate following another player 
    145 #define PMF_QUEUED          8192    // player is queued 
    146 #define PMF_TIME_WALLJUMP   16384   // for limiting wall jumping 
    147 #define PMF_CHARGE          32768   // keep track of pouncing 
    148 #define PMF_WEAPON_SWITCH   65536   // force a weapon switch 
     146#define PMF_QUEUED          8192    //TA: player is queued 
     147#define PMF_TIME_WALLJUMP   16384   //TA: for limiting wall jumping 
     148#define PMF_CHARGE          32768   //TA: keep track of pouncing 
     149#define PMF_WEAPON_SWITCH   65536   //TA: force a weapon switch 
    149150 
    150151 
     
    167168  int           debugLevel;     // if set, diagnostic output will be printed 
    168169  qboolean      noFootsteps;    // if the game is setup for no footsteps by the server 
    169   qboolean      autoWeaponHit[ 32 ]; 
     170  qboolean      autoWeaponHit[ 32 ]; //FIXME: TA: remind myself later this might be a problem 
    170171 
    171172  int           framecount; 
     
    199200void PM_UpdateViewAngles( playerState_t *ps, const usercmd_t *cmd ); 
    200201void Pmove( pmove_t *pmove ); 
     202void PmovePredict( pmove_t *pmove, float frametime ); 
    201203 
    202204//=================================================================================== 
     
    208210  STAT_HEALTH, 
    209211  STAT_ITEMS, 
    210   STAT_SLOTS,           // tracks the amount of stuff human players are carrying 
     212  STAT_SLOTS,           //TA: tracks the amount of stuff human players are carrying 
    211213  STAT_ACTIVEITEMS, 
    212214  STAT_WEAPONS,         // 16 bit fields 
    213   STAT_WEAPONS2,        // another 16 bits to push the max weapon count up 
     215  STAT_WEAPONS2,        //TA: another 16 bits to push the max weapon count up 
    214216  STAT_MAX_HEALTH, // health / armor limit, changable by handicap 
    215   STAT_PCLASS,    // player class (for aliens AND humans) 
    216   STAT_PTEAM,     // player team 
    217   STAT_STAMINA,   // stamina (human only) 
    218   STAT_STATE,     // client states e.g. wall climbing 
    219   STAT_MISC,      // for uh...misc stuff 
    220   STAT_BUILDABLE, // which ghost model to display for building 
    221   STAT_FALLDIST,  // the distance the player fell 
    222   STAT_VIEWLOCK   // direction to lock the view in 
     217  STAT_PCLASS,    //TA: player class (for aliens AND humans) 
     218  STAT_PTEAM,     //TA: player team 
     219  STAT_STAMINA,   //TA: stamina (human only) 
     220  STAT_STATE,     //TA: client states e.g. wall climbing 
     221  STAT_MISC,      //TA: for uh...misc stuff 
     222  STAT_BUILDABLE, //TA: which ghost model to display for building 
     223  STAT_BOOSTTIME, //TA: time left for boost (alien only) 
     224  STAT_FALLDIST,  //TA: the distance the player fell 
     225  STAT_VIEWLOCK   //TA: direction to lock the view in 
    223226} statIndex_t; 
    224227 
     
    264267  PERS_KILLED,          // count of the number of times you died 
    265268 
     269  //TA: 
    266270  PERS_STATE, 
    267271  PERS_CREDIT,    // human credit 
     
    282286#define EF_BOUNCE_HALF      0x00000010    // for missiles 
    283287#define EF_NO_BOUNCE_SOUND  0x00000020    // for missiles 
    284 #define EF_WALLCLIMB        0x00000040    // wall walking 
    285 #define EF_WALLCLIMBCEILING 0x00000080    // wall walking ceiling hack 
     288#define EF_WALLCLIMB        0x00000040    // TA: wall walking 
     289#define EF_WALLCLIMBCEILING 0x00000080    // TA: wall walking ceiling hack 
    286290#define EF_NODRAW           0x00000100    // may have an event, but no model (unspawned items) 
    287291#define EF_FIRING           0x00000200    // for lightning gun 
     
    293297#define EF_VOTED            0x00008000    // already cast a vote 
    294298#define EF_TEAMVOTED        0x00010000    // already cast a vote 
    295 #define EF_BLOBLOCKED       0x00020000    // caught by a trapper 
    296 #define EF_REAL_LIGHT       0x00040000    // light sprites according to ambient light 
     299#define EF_BLOBLOCKED       0x00020000    // TA: caught by a trapper 
     300#define EF_REAL_LIGHT       0x00040000    // TA: light sprites according to ambient light 
     301 
     302typedef enum 
     303{ 
     304  PW_NONE, 
     305 
     306  PW_QUAD, 
     307  PW_BATTLESUIT, 
     308  PW_HASTE, 
     309  PW_INVIS, 
     310  PW_REGEN, 
     311  PW_FLIGHT, 
     312 
     313  PW_REDFLAG, 
     314  PW_BLUEFLAG, 
     315  PW_BALL, 
     316 
     317  PW_NUM_POWERUPS 
     318} powerup_t; 
    297319 
    298320typedef enum 
     
    386408} WUTeam_t; 
    387409 
    388 // bitmasks for upgrade slots 
     410//TA: bitmasks for upgrade slots 
    389411#define SLOT_NONE       0x00000000 
    390412#define SLOT_HEAD       0x00000001 
     
    503525  EV_FIRE_WEAPON3, 
    504526 
    505   EV_PLAYER_RESPAWN, // for fovwarp effects 
     527  EV_PLAYER_RESPAWN, //TA: for fovwarp effects 
    506528  EV_PLAYER_TELEPORT_IN, 
    507529  EV_PLAYER_TELEPORT_OUT, 
     
    535557  EV_GIB_PLAYER,      // gib a previously living player 
    536558 
    537   EV_BUILD_CONSTRUCT, 
    538   EV_BUILD_DESTROY, 
    539   EV_BUILD_DELAY,     // can't build yet 
    540   EV_BUILD_REPAIR,    // repairing buildable 
    541   EV_BUILD_REPAIRED,  // buildable has full health 
     559  EV_BUILD_CONSTRUCT, //TA 
     560  EV_BUILD_DESTROY,   //TA 
     561  EV_BUILD_DELAY,     //TA: can't build yet 
     562  EV_BUILD_REPAIR,    //TA: repairing buildable 
     563  EV_BUILD_REPAIRED,  //TA: buildable has full health 
    542564  EV_HUMAN_BUILDABLE_EXPLOSION, 
    543565  EV_ALIEN_BUILDABLE_EXPLOSION, 
     
    553575  EV_TAUNT, 
    554576 
    555   EV_OVERMIND_ATTACK, // overmind under attack 
    556   EV_OVERMIND_DYING,  // overmind close to death 
    557   EV_OVERMIND_SPAWNS, // overmind needs spawns 
    558  
    559   EV_DCC_ATTACK,      // dcc under attack 
    560  
    561   EV_RPTUSE_SOUND     // trigger a sound 
     577  EV_OVERMIND_ATTACK, //TA: overmind under attack 
     578  EV_OVERMIND_DYING,  //TA: overmind close to death 
     579  EV_OVERMIND_SPAWNS, //TA: overmind needs spawns 
     580 
     581  EV_DCC_ATTACK,      //TA: dcc under attack 
     582 
     583  EV_RPTUSE_SOUND     //TA: trigger a sound 
    562584} entity_event_t; 
    563585 
     
    716738} nonSegPlayerAnimNumber_t; 
    717739 
    718 // for buildable animations 
     740//TA: for buildable animations 
    719741typedef enum 
    720742{ 
     
    776798#define TEAM_MAXOVERLAY   32 
    777799 
    778 // player classes 
     800//TA: player classes 
    779801typedef enum 
    780802{ 
     
    803825 
    804826 
    805 // player teams 
     827//TA: player teams 
    806828typedef enum 
    807829{ 
     
    872894//--------------------------------------------------------- 
    873895 
    874 // player class record 
     896//TA: player class record 
    875897typedef struct 
    876898{ 
     
    879901  char      *className; 
    880902  char      *humanName; 
    881   char      *info; 
    882903 
    883904  char      *modelName; 
     
    957978#define MAX_BUILDABLE_MODELS 4 
    958979 
    959 // buildable item record 
     980//TA: buildable item record 
    960981typedef struct 
    961982{ 
     
    964985  char      *buildName; 
    965986  char      *humanName; 
    966   char      *info; 
    967987  char      *entityName; 
    968988 
     
    10231043} buildableAttributeOverrides_t; 
    10241044 
    1025 // weapon record 
     1045//TA: weapon record 
    10261046typedef struct 
    10271047{ 
     
    10351055  char      *weaponName; 
    10361056  char      *weaponHumanName; 
    1037   char      *info; 
    10381057 
    10391058  int       maxAmmo; 
     
    10621081} weaponAttributes_t; 
    10631082 
    1064 // upgrade record 
     1083//TA: upgrade record 
    10651084typedef struct 
    10661085{ 
     
    10741093  char      *upgradeName; 
    10751094  char      *upgradeHumanName; 
    1076   char      *info; 
    10771095 
    10781096  char      *icon; 
     
    10841102} upgradeAttributes_t; 
    10851103 
     1104 
     1105//TA: 
    10861106void      BG_UnpackAmmoArray( int weapon, int psAmmo[ ], int psAmmo2[ ], int *ammo, int *clips ); 
    10871107void      BG_PackAmmoArray( int weapon, int psAmmo[ ], int psAmmo2[ ], int ammo, int clips ); 
     
    10981118qboolean  BG_RotateAxis( vec3_t surfNormal, vec3_t inAxis[ 3 ], 
    10991119                         vec3_t outAxis[ 3 ], qboolean inverse, qboolean ceiling ); 
    1100 void      BG_GetClientNormal( const playerState_t *ps, vec3_t normal ); 
    11011120void      BG_PositionBuildableRelativeToPlayer( const playerState_t *ps, 
    11021121                                                const vec3_t mins, const vec3_t maxs, 
     
    11111130char      *BG_FindHumanNameForBuildable( int bclass ); 
    11121131char      *BG_FindEntityNameForBuildable( int bclass ); 
    1113 char      *BG_FindInfoForBuildable( int bclass ); 
    11141132char      *BG_FindModelsForBuildable( int bclass, int modelNum ); 
    11151133float     BG_FindModelScaleForBuildable( int bclass ); 
     
    11471165char      *BG_FindNameForClassNum( int pclass ); 
    11481166char      *BG_FindHumanNameForClassNum( int pclass ); 
    1149 char      *BG_FindInfoForClassNum( int pclass ); 
    11501167char      *BG_FindModelNameForClass( int pclass ); 
    11511168float     BG_FindModelScaleForClass( int pclass ); 
     
    11851202int       BG_FindWeaponNumForName( char *name ); 
    11861203char      *BG_FindHumanNameForWeapon( int weapon ); 
    1187 char      *BG_FindInfoForWeapon( int weapon ); 
    11881204char      *BG_FindModelsForWeapon( int weapon, int modelNum ); 
    11891205char      *BG_FindIconForWeapon( int weapon ); 
     
    12131229int       BG_FindUpgradeNumForName( char *name ); 
    12141230char      *BG_FindHumanNameForUpgrade( int upgrade ); 
    1215 char      *BG_FindInfoForUpgrade( int upgrade ); 
    12161231char      *BG_FindIconForUpgrade( int upgrade ); 
    12171232qboolean  BG_FindPurchasableForUpgrade( int upgrade ); 
     
    12381253  ET_ITEM, 
    12391254 
    1240   ET_BUILDABLE,       // buildable type 
     1255  ET_BUILDABLE,       //TA: buildable type 
    12411256 
    12421257  ET_MISSILE, 
  • src/game/bg_slidemove.c

    r118 r0  
    299299  qboolean  stepped = qfalse; 
    300300 
    301   BG_GetClientNormal( pm->ps, normal ); 
     301  if( pm->ps->stats[ STAT_STATE ] & SS_WALLCLIMBING ) 
     302  { 
     303    if( pm->ps->stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) 
     304      VectorSet( normal, 0.0f, 0.0f, -1.0f ); 
     305    else 
     306      VectorCopy( pm->ps->grapplePoint, normal ); 
     307  } 
     308  else 
     309    VectorSet( normal, 0.0f, 0.0f, 1.0f ); 
    302310 
    303311  VectorCopy( pm->ps->origin, start_o ); 
  • src/game/g_active.c

    r122 r1  
    526526  usercmd_t *ucmd; 
    527527  int       aForward, aRight; 
    528   qboolean  walking = qfalse, stopped = qfalse, 
    529             crouched = qfalse, jumping = qfalse, 
    530             strafing = qfalse; 
    531   int       i; 
    532528 
    533529  ucmd = &ent->client->pers.cmd; 
     
    535531  aForward  = abs( ucmd->forwardmove ); 
    536532  aRight    = abs( ucmd->rightmove ); 
    537  
    538   if( aForward == 0 && aRight == 0 ) 
    539     stopped = qtrue; 
    540   else if( aForward <= 64 && aRight <= 64 ) 
    541     walking = qtrue; 
    542  
    543   if( aRight > 0 ) 
    544     strafing = qtrue; 
    545  
    546   if( ucmd->upmove > 0 ) 
    547     jumping = qtrue; 
    548   else if( ucmd->upmove < 0 ) 
    549     crouched = qtrue; 
    550533 
    551534  client = ent->client; 
     
    559542 
    560543    //if not trying to run then not trying to sprint 
    561     if( walking || stopped ) 
     544    if( aForward <= 64 ) 
    562545      client->ps.stats[ STAT_STATE ] &= ~SS_SPEEDBOOST; 
    563546 
    564547    if( BG_InventoryContainsUpgrade( UP_JETPACK, client->ps.stats ) && BG_UpgradeIsActive( UP_JETPACK, client->ps.stats ) ) 
    565     { 
    566       //don't run when jetpack on 
    567548      client->ps.stats[ STAT_STATE ] &= ~SS_SPEEDBOOST; 
    568     } 
    569  
    570     if( ( client->ps.stats[ STAT_STATE ] & SS_SPEEDBOOST ) && !crouched ) 
     549 
     550    if( ( client->ps.stats[ STAT_STATE ] & SS_SPEEDBOOST ) &&  ucmd->upmove >= 0 ) 
    571551    { 
    572552      //subtract stamina 
     
    580560    } 
    581561 
    582     if( walking || crouched ) 
     562    if( ( aForward <= 64 && aForward > 5 ) || ( aRight <= 64 && aRight > 5 ) ) 
    583563    { 
    584564      //restore stamina 
     
    588568        client->ps.stats[ STAT_STAMINA ] = MAX_STAMINA; 
    589569    } 
    590     else if( stopped ) 
     570    else if( aForward <= 5 && aRight <= 5 ) 
    591571    { 
    592572      //restore stamina faster 
     
    658638 
    659639          //if the charger has stopped moving take a chunk of charge away 
    660           if( VectorLength( client->ps.velocity ) < 64.0f || strafing ) 
     640          if( VectorLength( client->ps.velocity ) < 64.0f || aRight ) 
    661641            client->ps.stats[ STAT_MISC ] = client->ps.stats[ STAT_MISC ] / 2; 
    662642 
     
    712692          else 
    713693            client->ps.stats[ STAT_BUILDABLE ] &= ~SB_VALID_TOGGLEBIT; 
    714  
    715           // Let the client know which buildables will be removed by building 
    716           for( i = 0; i < MAX_POWERUPS; i++ ) 
    717           { 
    718             if( i < level.numBuildablesForRemoval ) 
    719               client->ps.powerups[ i ] = level.markedBuildables[ i ]->s.number; 
    720             else 
    721               client->ps.powerups[ i ] = 0; 
    722           } 
    723         } 
    724         else 
    725         { 
    726           for( i = 0; i < MAX_POWERUPS; i++ ) 
    727             client->ps.powerups[ i ] = 0; 
    728694        } 
    729695 
     
    783749    client->time1000 -= 1000; 
    784750 
    785     //jetpack power management 
    786     if( BG_InventoryContainsUpgrade( UP_JETPACK, client->ps.stats ) ) 
    787     { 
    788       if(BG_UpgradeIsActive( UP_JETPACK, client->ps.stats ) ) 
    789       { 
    790         if(g_jetpackLimit.integer > 0) 
    791         { 
    792           //decrease jetpack power 
    793           if(client->jetpack_power > 0) 
    794           { 
    795             client->jetpack_power--; 
    796  
    797             //if no power, can't reactive jetpack for a moment 
    798             if(client->jetpack_power == 0) 
    799               client->jetpack_beat = g_jetpackLimit.integer / 10; 
    800           } 
    801         } 
    802       } 
    803       else 
    804       { 
    805         //recover jetpack 
    806         if(client->jetpack_beat > 0) 
    807           client->jetpack_beat--; 
    808         else if( level.reactorPresent && client->jetpack_power < g_jetpackLimit.integer) 
    809           client->jetpack_power++; 
    810       } 
    811     } 
    812  
    813751    //client is poison clouded 
    814752    if( client->ps.stats[ STAT_STATE ] & SS_POISONCLOUDED ) 
     
    864802        else if( boostEntity->s.eType == ET_BUILDABLE && 
    865803            boostEntity->s.modelindex == BA_A_BOOSTER && 
    866             boostEntity->spawned && boostEntity->health > 0) 
     804            boostEntity->spawned ) 
    867805        { 
    868806          modifier = BOOSTER_REGEN_MOD; 
     
    878816        ent->health = client->ps.stats[ STAT_MAX_HEALTH ]; 
    879817    } 
    880  
    881     // turn off life support when a team admits defeat 
     818    
     819    // turn off life support when a team admits defeat  
    882820    if( client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS && 
    883821      level.surrenderTeam == PTE_ALIENS ) 
     
    12841222 postition sent in the most recent snapshot. 
    12851223 
    1286  This allows player X to essentially "move through" the position of player Y 
     1224 This allows player X to essentially "move through" the position of player Y  
    12871225 when player X's cmd is processed with Pmove() on the server.  This is because 
    12881226 player Y was clipping player X's Pmove() on his client, but when the same 
     
    13271265    ent->client->ps.origin, ent->s.number,  MASK_PLAYERSOLID ); 
    13281266  if( tr.entityNum >= 0 && tr.entityNum < MAX_CLIENTS ) 
    1329     g_entities[ tr.entityNum ].client->unlaggedCalc.used = qfalse; 
     1267    g_entities[ tr.entityNum ].client->unlaggedCalc.used = qfalse;  
    13301268 
    13311269  G_UnlaggedOff( ); 
     
    13591297  // mark the time, so the connection sprite can be removed 
    13601298  ucmd = &ent->client->pers.cmd; 
     1299 
     1300  if( g_maxWarp.integer > 0 && client->warping ) 
     1301  { 
     1302    int frames = ( level.framenum - client->lastUpdateFrame ); 
     1303    int maxtime = 0; 
     1304 
     1305    if( frames > g_maxWarp.integer ) 
     1306      frames = g_maxWarp.integer; 
     1307 
     1308    maxtime = ( frames  * ( level.time - level.previousTime ) ); 
     1309    //ucmd->serverTime = client->ps.commandTime + maxtime; 
     1310    ucmd->serverTime = level.previousTime; 
     1311    client->ps.commandTime = level.previousTime - maxtime; 
     1312    client->warped = qtrue; 
     1313  } 
     1314  client->warping = qfalse; 
     1315  client->lastUpdateFrame = level.framenum; 
    13611316 
    13621317  // sanity check the command time to prevent speedup cheating 
     
    14371392    return; 
    14381393 
    1439   // calculate where ent is currently seeing all the other active clients 
     1394  // calculate where ent is currently seeing all the other active clients  
    14401395  G_UnlaggedCalc( ent->client->unlaggedTime, ent ); 
    14411396 
     
    14671422    client->ps.stats[ STAT_STATE ] &= ~SS_SLOWLOCKED; 
    14681423 
     1424  client->ps.stats[ STAT_BOOSTTIME ] = level.time - client->lastBoostedTime; 
     1425 
    14691426  if( client->ps.stats[ STAT_STATE ] & SS_BOOSTED && 
    14701427      client->lastBoostedTime + BOOST_TIME < level.time ) 
     
    15421499    } 
    15431500 
    1544     //switch jetpack off if no power 
    1545     if( g_jetpackLimit.integer && (client->jetpack_beat || !client->jetpack_power)) 
    1546     { 
     1501    //switch jetpack off if no reactor 
     1502    if( !level.reactorPresent ) 
    15471503      BG_DeactivateUpgrade( UP_JETPACK, client->ps.stats ); 
    1548  
    1549       trap_SendServerCommand( ent - g_entities, 
    1550         "print \"Your jetpack is out of power\n\"" ); 
    1551     } 
    15521504  } 
    15531505 
     
    16471599  // touch other objects 
    16481600  ClientImpacts( ent, &pm ); 
    1649  
     1601   
    16501602  // execute client events 
    16511603  ClientEvents( ent, oldEventSequence ); 
     
    16611613  if( ent->client->ps.eventSequence != oldEventSequence ) 
    16621614    ent->eventTime = level.time; 
    1663  
    1664   // Don't think anymore if dead 
    1665   if( client->ps.stats[ STAT_HEALTH ] <= 0 ) 
    1666     return; 
    16671615 
    16681616  // swap and latch button actions 
     
    17121660      int       i, num; 
    17131661 
    1714       // look for object infront of player 
     1662      //TA: look for object infront of player 
    17151663      AngleVectors( client->ps.viewangles, view, NULL, NULL ); 
    17161664      VectorMA( client->ps.origin, USE_OBJECT_RANGE, view, point ); 
     
    17571705  } 
    17581706 
     1707  // check for respawning 
     1708  if( client->ps.stats[ STAT_HEALTH ] <= 0 ) 
     1709  { 
     1710    // wait for the attack button to be pressed 
     1711    if( level.time > client->respawnTime ) 
     1712    { 
     1713      // forcerespawn is to prevent users from waiting out powerups 
     1714      if( g_forcerespawn.integer > 0 && 
     1715        ( level.time - client->respawnTime ) > 0 ) 
     1716      { 
     1717        respawn( ent ); 
     1718        return; 
     1719      } 
     1720 
     1721      // pressing attack or use is the normal respawn method 
     1722      if( ucmd->buttons & ( BUTTON_ATTACK | BUTTON_USE_HOLDABLE ) ) 
     1723      { 
     1724        respawn( ent ); 
     1725      } 
     1726    } 
     1727    return; 
     1728  } 
     1729 
    17591730  if( level.framenum > client->retriggerArmouryMenu && client->retriggerArmouryMenu ) 
    17601731  { 
     
    17811752  // perform once-a-second actions 
    17821753  ClientTimerActions( ent, msec ); 
    1783  
     1754   
    17841755  if( ent->suicideTime > 0 && ent->suicideTime < level.time ) 
    17851756  { 
     
    18601831/* 
    18611832============== 
     1833 G_PredictPmove 
     1834 
     1835 Make use of the 'Pmove' functions to figure out where a player 
     1836 would have moved on their present course in frametime seconds. 
     1837 Link them at this predicted location and send it out in the next 
     1838 snapshot, BUT don't alter their location so subsequent cmds from 
     1839 this client process as though nothing has happened. 
     1840============== 
     1841*/ 
     1842static void G_PredictPmove( gentity_t *ent, float frametime ) 
     1843{ 
     1844  pmove_t pm; 
     1845  pmoveExt_t pmext; 
     1846  playerState_t ps; 
     1847  vec3_t currentOrigin; 
     1848 
     1849  if( !ent || !ent->inuse || !ent->r.linked || !ent->client || 
     1850      ent->health < 1 || ent->client->ps.pm_type != PM_NORMAL || 
     1851      ent->waterlevel > 1 ) 
     1852  { 
     1853    return; 
     1854  } 
     1855 
     1856  memset( &pm, 0, sizeof( pm ) ); 
     1857  memcpy( &ps, &ent->client->ps, sizeof( ps ) ); 
     1858  memcpy( &pmext, &ent->client->pmext, sizeof( pmext ) ); 
     1859  pm.ps = &ps; 
     1860  pm.pmext = &pmext; 
     1861  pm.trace = trap_Trace; 
     1862  pm.pointcontents = trap_PointContents; 
     1863  pm.tracemask = MASK_PLAYERSOLID; 
     1864  VectorCopy( ent->r.mins, pm.mins ); 
     1865  VectorCopy( ent->r.maxs, pm.maxs ); 
     1866 
     1867  PmovePredict( &pm, frametime ); 
     1868  SnapVector( ps.origin ); 
     1869  SnapVector( ps.velocity ); 
     1870 
     1871  // link the entity at this new location so they can be hit there but don't 
     1872  // really move them since it will interfere with movement 
     1873  VectorCopy( ent->r.currentOrigin , currentOrigin ); 
     1874  VectorCopy( ps.origin, ent->r.currentOrigin ); 
     1875  trap_LinkEntity( ent ); 
     1876  VectorCopy( currentOrigin, ent->r.currentOrigin ); 
     1877 
     1878  // send this new origin/velocity in the next snapshot 
     1879  VectorCopy( ps.origin, ent->s.pos.trBase ); 
     1880  VectorCopy( ps.velocity, ent->s.pos.trDelta ); 
     1881} 
     1882 
     1883/* 
     1884============== 
    18621885ClientEndFrame 
    18631886 
     
    18701893{ 
    18711894  clientPersistant_t  *pers; 
     1895  int frames; 
    18721896 
    18731897   if (ent->client->pers.floodTimer) 
     
    19071931  ent->client->ps.stats[ STAT_HEALTH ] = ent->health; // FIXME: get rid of ent->health... 
    19081932 
    1909   // respawn if dead 
    1910   if( ent->client->ps.stats[ STAT_HEALTH ] <= 0 && level.time >= ent->client->respawnTime ) 
    1911     respawn( ent ); 
    1912  
    19131933  G_SetClientSound( ent ); 
    19141934 
     
    19201940 
    19211941  SendPendingPredictableEvents( &ent->client->ps ); 
     1942 
     1943  // see how many frames the client has missed 
     1944  frames = level.framenum - ent->client->lastUpdateFrame - 1; 
     1945 
     1946  if( g_maxWarp.integer > 0 ) 
     1947  { 
     1948    if( frames > g_maxWarp.integer ) 
     1949    { 
     1950      ent->client->warping = qtrue; 
     1951      frames = g_maxWarp.integer; 
     1952    }  
     1953  } 
     1954  else if( frames > 3 ) 
     1955    frames = 3; 
     1956 
     1957  if( g_skipCorrection.integer && !ent->client->warped && frames > 0 ) 
     1958  { 
     1959    float pmtime = 0.001f * ( frames * ( level.time - level.previousTime ) ); 
     1960 
     1961    G_PredictPmove( ent, pmtime ); 
     1962  } 
     1963  ent->client->warped = qfalse; 
    19221964} 
    19231965 
  • src/game/g_admin.c

    r122 r1  
    5454    }, 
    5555 
     56    {"woolball", G_admin_woolball, "w", 
     57      "send a wool ball" 
     58    }, 
     59 
    5660    {"ban", G_admin_ban, "b", 
    5761      "ban a player by IP and GUID with an optional expiration time and reason." 
     
    8892    {"listadmins", G_admin_listadmins, "D", 
    8993      "display a list of all server admins and their levels", 
    90       "(^5name|start admin#^7) (^5minimum level to display^7)" 
     94      "(^5name|start admin#^7)" 
    9195    }, 
    9296     
     
    140144      "" 
    141145    }, 
    142      
    143     {"register", G_admin_register, "R", 
    144       "Registers your name to protect it from being used by others or updates your admin name to your current name.", 
    145       "" 
    146     }, 
    147146 
    148147    {"rename", G_admin_rename, "N", 
     
    192191      "unmute a muted player", 
    193192      "[^3name|slot#^7]" 
    194     }, 
    195  
    196     { 
    197      "warn", G_admin_warn, "w", 
    198       "Warn a player to cease or face admin intervention", 
    199       "[^3name|slot#^7] [reason]" 
    200193    } 
    201194  }; 
     
    640633  Q_strncpyz( g_admin_levels[ 3 ]->name, "^2Junior Admin", 
    641634    sizeof( l->name ) ); 
    642   Q_strncpyz( g_admin_levels[ 3 ]->flags, "iahCpPkm?", sizeof( l->flags ) ); 
    643    
     635  Q_strncpyz( g_admin_levels[ 3 ]->flags, "iahCpPkm", sizeof( l->flags ) ); 
     636 
    644637  Q_strncpyz( g_admin_levels[ 4 ]->name, "^3Senior Admin", 
    645638    sizeof( l->name ) ); 
    646   Q_strncpyz( g_admin_levels[ 4 ]->flags, "iahCpPkmBbe?", sizeof( l->flags ) ); 
    647    
     639  Q_strncpyz( g_admin_levels[ 4 ]->flags, "iahCpPkmBbe", sizeof( l->flags ) ); 
     640 
    648641  Q_strncpyz( g_admin_levels[ 5 ]->name, "^1Server Operator", 
    649642    sizeof( l->name ) ); 
     
    761754  { 
    762755    G_SayArgv( 1 + skiparg, name, sizeof( name ) ); 
    763     if( G_ClientNumbersFromString( name, pids, MAX_CLIENTS ) == 1 ) 
     756    if( G_ClientNumbersFromString( name, pids ) == 1 ) 
    764757    { 
    765758      victim = &g_entities[ pids[ 0 ] ]; 
     
    803796} 
    804797 
    805 static int admin_listadmins( gentity_t *ent, int start, char *search, int minlevel ) 
     798static int admin_listadmins( gentity_t *ent, int start, char *search ) 
    806799{ 
    807800  int drawn = 0; 
     
    862855  for( i = start; i < MAX_ADMIN_ADMINS && g_admin_admins[ i ] 
    863856    && drawn < MAX_ADMIN_LISTITEMS; i++ ) 
    864    if( g_admin_admins[ i ]->level >= minlevel )  
    865    { 
    866      if( search[ 0 ] ) 
    867      { 
    868        G_SanitiseName( g_admin_admins[ i ]->name, name ); 
    869        if( !strstr( name, search ) ) 
    870          continue; 
     857  { 
     858    if( search[ 0 ] ) 
     859    { 
     860      G_SanitiseName( g_admin_admins[ i ]->name, name ); 
     861      if( !strstr( name, search ) ) 
     862        continue; 
    871863       
    872        // verify we don't have the same guid/name pair in connected players 
    873        // since we don't want to draw the same player twice 
    874        dup = qfalse; 
    875        for( j = 0; j < level.maxclients; j++ ) 
    876        { 
    877          vic = &g_entities[ j ]; 
    878          if( !vic->client || vic->client->pers.connected != CON_CONNECTED ) 
    879            continue; 
    880          G_SanitiseName( vic->client->pers.netname, name2 ); 
    881          if( !Q_stricmp( vic->client->pers.guid, g_admin_admins[ i ]->guid ) 
    882            && strstr( name2, search ) )  
    883          { 
    884            dup = qtrue; 
    885            break; 
    886          } 
    887        } 
    888        if( dup ) 
    889          continue; 
    890      } 
    891      for( j = 0; j <= 8; j++ ) 
    892        guid_stub[ j ] = g_admin_admins[ i ]->guid[ j + 24 ]; 
    893      guid_stub[ j ] = '\0'; 
    894      
    895      lname[ 0 ] = '\0';  
    896      Q_strncpyz( lname_fmt, "%s", sizeof( lname_fmt ) ); 
    897      for( j = 0; j < MAX_ADMIN_LEVELS && g_admin_levels[ j ]; j++ ) 
    898      { 
    899        if( g_admin_levels[ j ]->level == g_admin_admins[ i ]->level ) 
    900        { 
    901          G_DecolorString( g_admin_levels[ j ]->name, lname ); 
    902          Com_sprintf( lname_fmt, sizeof( lname_fmt ), "%%%is", 
    903            ( admin_level_maxname + strlen( g_admin_levels[ j ]->name ) 
    904              - strlen( lname ) ) ); 
    905          Com_sprintf( lname, sizeof( lname ), lname_fmt, 
    906             g_admin_levels[ j ]->name ); 
    907          break; 
    908        } 
    909      } 
    910      ADMBP( va( "%4i %4i %s^7 (*%s) %s^7\n", 
    911        ( i + MAX_CLIENTS ), 
    912        g_admin_admins[ i ]->level, 
    913        lname, 
    914        guid_stub, 
    915        g_admin_admins[ i ]->name ) ); 
    916      drawn++; 
    917    } 
     864      // verify we don't have the same guid/name pair in connected players 
     865      // since we don't want to draw the same player twice 
     866      dup = qfalse; 
     867      for( j = 0; j < level.maxclients; j++ ) 
     868      { 
     869        vic = &g_entities[ j ]; 
     870        if( !vic->client || vic->client->pers.connected != CON_CONNECTED ) 
     871          continue; 
     872        G_SanitiseName( vic->client->pers.netname, name2 ); 
     873        if( !Q_stricmp( vic->client->pers.guid, g_admin_admins[ i ]->guid ) 
     874          && strstr( name2, search ) )  
     875        { 
     876          dup = qtrue; 
     877          break; 
     878        } 
     879      } 
     880      if( dup ) 
     881        continue; 
     882    } 
     883    for( j = 0; j <= 8; j++ ) 
     884      guid_stub[ j ] = g_admin_admins[ i ]->guid[ j + 24 ]; 
     885    guid_stub[ j ] = '\0'; 
     886    
     887    lname[ 0 ] = '\0';  
     888    Q_strncpyz( lname_fmt, "%s", sizeof( lname_fmt ) ); 
     889    for( j = 0; j < MAX_ADMIN_LEVELS && g_admin_levels[ j ]; j++ ) 
     890    { 
     891      if( g_admin_levels[ j ]->level == g_admin_admins[ i ]->level ) 
     892      { 
     893        G_DecolorString( g_admin_levels[ j ]->name, lname ); 
     894        Com_sprintf( lname_fmt, sizeof( lname_fmt ), "%%%is", 
     895          ( admin_level_maxname + strlen( g_admin_levels[ j ]->name ) 
     896            - strlen( lname ) ) ); 
     897        Com_sprintf( lname, sizeof( lname ), lname_fmt, 
     898           g_admin_levels[ j ]->name ); 
     899        break; 
     900      } 
     901    } 
     902    ADMBP( va( "%4i %4i %s^7 (*%s) %s^7\n", 
     903      ( i + MAX_CLIENTS ), 
     904      g_admin_admins[ i ]->level, 
     905      lname, 
     906      guid_stub, 
     907      g_admin_admins[ i ]->name ) ); 
     908    drawn++; 
     909  } 
    918910  ADMBP_end(); 
    919911  return drawn; 
     
    10361028    if( admin_command_permission( ent, cmd ) ) 
    10371029    { 
    1038       int j; 
    1039       trap_Cvar_Register( NULL, "arg_all", "", CVAR_TEMP | CVAR_ROM | CVAR_USER_CREATED ); 
    1040       trap_Cvar_Set( "arg_all", G_SayConcatArgs( skip + 1 ) ); 
    1041       trap_Cvar_Register( NULL, "arg_count", "", CVAR_TEMP | CVAR_ROM | CVAR_USER_CREATED ); 
    1042       trap_Cvar_Set( "arg_count", va( "%i", G_SayArgc() - ( skip + 1 ) ) ); 
    1043       trap_Cvar_Register( NULL, "arg_client", "", CVAR_TEMP | CVAR_ROM | CVAR_USER_CREATED ); 
    1044       trap_Cvar_Set( "arg_client", (ent) ? ent->client->pers.netname : "console" ); 
    1045       for (j = G_SayArgc() - ( skip + 1 ); j; j--) 
    1046       { 
    1047         char this_arg[ MAX_CVAR_VALUE_STRING ]; 
    1048         trap_Cvar_Register( NULL, va( "arg_%i", j ), "", CVAR_TEMP | CVAR_ROM | CVAR_USER_CREATED ); 
    1049         G_SayArgv( j + skip, this_arg, sizeof( this_arg ) ); 
    1050         trap_Cvar_Set( va( "arg_%i", j ), this_arg ); 
    1051       } 
    10521030      trap_SendConsoleCommand( EXEC_APPEND, g_admin_commands[ i ]->exec ); 
    10531031      admin_log( ent, cmd, skip ); 
     
    11271105        sizeof( g_admin_namelog[ i ]->name[ j ] ) ); 
    11281106      g_admin_namelog[ i ]->slot = ( disconnect ) ? -1 : clientNum; 
    1129  
    1130       // if this player is connecting, they are no longer banned 
    1131       if( !disconnect ) 
    1132         g_admin_namelog[ i ]->banned = qfalse; 
    1133  
    11341107      return; 
    11351108    } 
     
    15701543    ADMP( "^3!setlevel:^7 more than one match.  Use the admin number " 
    15711544      "instead:\n" ); 
    1572     admin_listadmins( ent, 0, name, 0 ); 
     1545    admin_listadmins( ent, 0, name ); 
    15731546    return qfalse; 
    15741547  } 
     
    16301603  char *ip, 
    16311604  int seconds, 
    1632   char *reason, 
    1633   int index ) 
     1605  char *reason )  
    16341606{ 
    16351607  g_admin_ban_t *b = NULL; 
     
    16661638  else 
    16671639    Q_strncpyz( b->reason, reason, sizeof( b->reason ) ); 
    1668  
    1669   if (index == ADM_NEW_BAN) { 
    1670     for( i = 0; i < MAX_ADMIN_BANS && g_admin_bans[ i ]; i++ ) ;         
    1671     if( i == MAX_ADMIN_BANS ) 
    1672     { 
    1673       ADMP( "^3!ban: ^7too many bans\n" ); 
    1674       G_Free( b ); 
    1675       return qfalse; 
    1676     } 
    1677   } else i = index; 
     1640  for( i = 0; i < MAX_ADMIN_BANS && g_admin_bans[ i ]; i++ ) 
     1641    ; 
     1642  if( i == MAX_ADMIN_BANS ) 
     1643  { 
     1644    ADMP( "^3!ban: ^7too many bans\n" ); 
     1645    G_Free( b ); 
     1646    return qfalse; 
     1647  } 
    16781648  g_admin_bans[ i ] = b; 
    16791649  return qtrue; 
     
    16821652qboolean G_admin_slap( gentity_t *ent, int skiparg ) 
    16831653{ 
    1684   int pids[ MAX_CLIENTS ], found, damage = 0; 
     1654  int pids[ MAX_CLIENTS ], damage = 0; 
    16851655  char name[ MAX_NAME_LENGTH ], err[ MAX_STRING_CHARS ], 
    16861656    command[ MAX_ADMIN_CMD_LEN ], *cmd; 
     
    17001670    cmd++; 
    17011671  G_SayArgv( 1 + skiparg, name, sizeof( name ) ); 
    1702   if( ( found = G_ClientNumbersFromString( name, pids, MAX_CLIENTS ) ) != 1 ) 
    1703   { 
    1704     G_MatchOnePlayer( pids, found, err, sizeof( err ) ); 
     1672  if( G_ClientNumbersFromString( name, pids ) != 1 ) 
     1673  { 
     1674    G_MatchOnePlayer( pids, err, sizeof( err ) ); 
    17051675    ADMP( va( "^3!slap: ^7%s\n", err ) ); 
    17061676    return qfalse; 
     
    17871757      if( damage < 0 ) damage = 0; 
    17881758    } else { 
     1759      if( g_slapDamage.integer > 100 ) g_slapDamage.integer = 100; 
    17891760      damage = BG_FindHealthForClass( vic->client->ps.stats[ STAT_PCLASS ] ) * 
    1790         ( g_slapDamage.integer > 100 ? 100 : g_slapDamage.integer ) / 100; 
    1791  
    1792       if( damage < 1 ) 
    1793         damage = 1; 
    1794     } 
    1795  
    1796     G_Damage( vic, NULL, NULL, NULL, NULL, damage, DAMAGE_NO_ARMOR, MOD_SLAP ); 
     1761        g_slapDamage.integer / 100; 
     1762      if( damage < 1 ) damage = 1; 
     1763    } 
     1764 
     1765    vic->health -= damage; 
     1766    vic->client->ps.stats[ STAT_HEALTH ] = vic->health; 
     1767    vic->lastDamageTime = level.time; 
     1768    if( vic->health <= 0 ) 
     1769    { 
     1770      vic->flags |= FL_NO_KNOCKBACK; 
     1771      vic->enemy = &g_entities[ pids[ 0 ] ]; 
     1772      vic->die( vic, 0, 0, damage, MOD_SLAP ); 
     1773    } else if( vic->pain ) vic->pain( vic, &g_entities[ pids[ 0 ] ], damage ); 
    17971774  } 
    17981775 
     
    18021779qboolean G_admin_kick( gentity_t *ent, int skiparg ) 
    18031780{ 
    1804   int pids[ MAX_CLIENTS ], found; 
     1781  int pids[ MAX_CLIENTS ]; 
    18051782  char name[ MAX_NAME_LENGTH ], *reason, err[ MAX_STRING_CHARS ]; 
    18061783  int minargc; 
     
    18181795  G_SayArgv( 1 + skiparg, name, sizeof( name ) ); 
    18191796  reason = G_SayConcatArgs( 2 + skiparg ); 
    1820   if( ( found = G_ClientNumbersFromString( name, pids, MAX_CLIENTS ) ) != 1 ) 
    1821   { 
    1822     G_MatchOnePlayer( pids, found, err, sizeof( err ) ); 
     1797  if( G_ClientNumbersFromString( name, pids ) != 1 ) 
     1798  { 
     1799    G_MatchOnePlayer( pids, err, sizeof( err ) ); 
    18231800    ADMP( va( "^3!kick: ^7%s\n", err ) ); 
    18241801    return qfalse; 
     
    18371814      vic->client->pers.guid, 
    18381815      vic->client->pers.ip, g_adminTempBan.integer, 
    1839       "automatic temp ban created by kick", 
    1840       ADM_NEW_BAN ); 
     1816      "automatic temp ban created by kick" ); 
    18411817    if( g_admin.string[ 0 ] ) 
    18421818      admin_writeconfig(); 
     
    18641840  char duration[ 32 ]; 
    18651841  int modifier = 1; 
    1866   int logmatch = -1, logmatches = 0, banmatches = 0, banmatch = -1; 
     1842  int logmatch = -1, logmatches = 0; 
    18671843  int i, j; 
    18681844  qboolean exactmatch = qfalse; 
     
    18701846  char s2[ MAX_NAME_LENGTH ]; 
    18711847  char guid_stub[ 9 ]; 
    1872   qtime_t qt; 
    1873   int t; 
    18741848 
    18751849  if( G_admin_permission( ent, ADMF_CAN_PERM_BAN ) && 
     
    18951869  G_SanitiseName( search, s2 ); 
    18961870  G_SayArgv( 2 + skiparg, secs, sizeof( secs ) ); 
    1897  
    1898   t = trap_RealTime( &qt ); 
    18991871 
    19001872  // support "w" (weeks), "d" (days), "h" (hours), and "m" (minutes) modifiers 
     
    19521924      break; 
    19531925    } 
    1954   } 
     1926  }  
    19551927 
    19561928  for( i = 0; 
     
    19591931  { 
    19601932    // skip players in the namelog who have already been banned 
    1961       if( g_admin_namelog[ i ]->banned ) 
    1962         continue; 
     1933    if( g_admin_namelog[ i ]->banned ) 
     1934      continue; 
    19631935 
    19641936    if( !Q_stricmp( g_admin_namelog[ i ]->ip, s2 ) ) 
     
    19691941      break; 
    19701942    } 
    1971     for( j = 0; j < MAX_ADMIN_NAMELOG_NAMES && g_admin_namelog[ i ]->name[ j ][ 0 ]; j++ ) 
     1943    for( j = 0; j < MAX_ADMIN_NAMELOG_NAMES 
     1944      && g_admin_namelog[ i ]->name[ j ][ 0 ]; j++ ) 
    19721945    { 
    19731946      G_SanitiseName(g_admin_namelog[ i ]->name[ j ], n2); 
     
    19811954  } 
    19821955   
    1983   // looking for banned clients that match the pattern, and for an eventually ban slot provided 
    1984   for ( i = 0; i < MAX_ADMIN_BANS && g_admin_bans[ i ] && !exactmatch; i++ ) { 
    1985       if( g_admin_bans[ i ]->expires != 0 && ( g_admin_bans[ i ]->expires - t ) < 1 ) continue; 
    1986       G_SanitiseName(g_admin_bans[i]->name, n2); 
    1987       if (strstr(n2, s2) || !Q_stricmp(g_admin_bans[i]->ip, s2) || !Q_stricmp(g_admin_bans[i]->guid, s2)) { 
    1988         banmatches++; 
    1989         banmatch = i; 
    1990       } 
    1991       if (!Q_stricmp (va( "%db", i), s2)) { 
    1992         banmatches = 1; 
    1993         banmatch = i; 
    1994         exactmatch = qtrue; 
    1995       } 
    1996   } 
    1997  
    1998   G_admin_duration( ( seconds ) ? seconds : -1, 
    1999     duration, sizeof( duration ) ); 
    2000  
    2001   if( logmatches + banmatches > 1 ) 
     1956  if( !logmatches )  
     1957  { 
     1958    ADMP( "^3!ban: ^7no player found by that name, IP, or slot number\n" ); 
     1959    return qfalse; 
     1960  }  
     1961  else if( logmatches > 1 ) 
    20021962  { 
    20031963    ADMBP_begin(); 
     
    20251985      } 
    20261986    } 
    2027  
    2028     for ( i = 0; i < MAX_ADMIN_BANS && g_admin_bans[ i ] && banmatches>=0; i++ ) { 
    2029       G_SanitiseName(g_admin_bans[i]->name, n2); 
    2030       if( g_admin_bans[ i ]->expires != 0 && ( g_admin_bans[ i ]->expires - t ) < 1 ) continue; 
    2031       if (strstr(n2, s2)) { 
    2032         for( j = 0; j <= 8; j++ ) guid_stub[ j ] = g_admin_bans[ i ]->guid[ j + 24 ]; 
    2033         guid_stub[ j ] = '\0'; 
    2034         ADMBP( va( "%-2s (*%s) %15s ^7'%s^7'\n", 
    2035         va( "%db", i ), 
    2036         guid_stub, 
    2037         g_admin_bans[ i ]->ip, 
    2038         g_admin_bans[ i ]->name )); 
    2039       } 
    2040     } 
    20411987    ADMBP_end(); 
    20421988    return qfalse; 
    20431989  } 
    2044   else if( banmatch != -1 ) 
    2045   { 
    2046      ADMP( "^3!ban: ^7client already banned, ban adjusted\n" ); 
    2047  
    2048      admin_create_ban( ent, 
    2049      g_admin_bans[banmatch]->name, 
    2050      g_admin_bans[banmatch]->guid, 
    2051      g_admin_bans[banmatch]->ip, 
    2052      seconds, reason, banmatch ); 
    2053  
    2054     if( !g_admin.string[ 0 ] ) 
    2055        ADMP( "^3!ban: ^7WARNING g_admin not set, not saving ban to a file\n" ); 
    2056     else 
    2057        admin_writeconfig(); 
    2058  
    2059     AP( va( "print \"^3!ban:^7 %s^7 has been banned by %s^7 " 
    2060       "duration: %s, reason: %s\n\"", 
    2061       g_admin_bans[banmatch]->name, 
    2062       ( ent ) ? ent->client->pers.netname : "console", 
    2063       duration, 
    2064       ( *reason ) ? reason : "banned by admin" ) ); 
    2065  
    2066     return qtrue;  
    2067   } else if (!logmatches) { 
    2068  
    2069     ADMP( "^3!ban: ^7no player found by that name, IP, or slot number\n" ); 
    2070     return qfalse; 
    2071      
    2072   } else { 
     1990   
     1991  G_admin_duration( ( seconds ) ? seconds : -1, 
     1992    duration, sizeof( duration ) ); 
    20731993 
    20741994  if( ent && !admin_higher_guid( ent->client->pers.guid, 
     
    20852005    g_admin_namelog[ logmatch ]->guid, 
    20862006    g_admin_namelog[ logmatch ]->ip, 
    2087     seconds, reason, ADM_NEW_BAN ); 
     2007    seconds, reason );  
    20882008 
    20892009  g_admin_namelog[ logmatch ]->banned = qtrue; 
     
    20952015 
    20962016  if(g_admin_namelog[ logmatch ]->slot == -1 )  
    2097   {  
     2017  { 
    20982018    // client is already disconnected so stop here 
    20992019    AP( va( "print \"^3!ban:^7 %s^7 has been banned by %s^7 " 
     
    21192039      ( *reason ) ? reason : "banned by admin" ) ); 
    21202040  return qtrue; 
    2121  
    2122   } 
    21232041} 
    21242042 
     
    21602078qboolean G_admin_putteam( gentity_t *ent, int skiparg ) 
    21612079{ 
    2162   int pids[ MAX_CLIENTS ], found; 
     2080  int pids[ MAX_CLIENTS ]; 
    21632081  char name[ MAX_NAME_LENGTH ], team[ 7 ], err[ MAX_STRING_CHARS ]; 
    21642082  gentity_t *vic; 
     
    21742092  } 
    21752093 
    2176   if( ( found = G_ClientNumbersFromString( name, pids, MAX_CLIENTS ) ) != 1 ) 
    2177   { 
    2178     G_MatchOnePlayer( pids, found, err, sizeof( err ) ); 
     2094  if( G_ClientNumbersFromString( name, pids ) != 1 ) 
     2095  { 
     2096    G_MatchOnePlayer( pids, err, sizeof( err ) ); 
    21792097    ADMP( va( "^3!putteam: ^7%s\n", err ) ); 
    21802098    return qfalse; 
     
    22592177qboolean G_admin_mute( gentity_t *ent, int skiparg ) 
    22602178{ 
    2261   int pids[ MAX_CLIENTS ], found; 
     2179  int pids[ MAX_CLIENTS ]; 
    22622180  char name[ MAX_NAME_LENGTH ], err[ MAX_STRING_CHARS ]; 
    22632181  char command[ MAX_ADMIN_CMD_LEN ], *cmd; 
     
    22742192    cmd++; 
    22752193  G_SayArgv( 1 + skiparg, name, sizeof( name ) ); 
    2276   if( ( found = G_ClientNumbersFromString( name, pids, MAX_CLIENTS ) ) != 1 ) 
    2277   { 
    2278     G_MatchOnePlayer( pids, found, err, sizeof( err ) ); 
     2194  if( G_ClientNumbersFromString( name, pids ) != 1 ) 
     2195  { 
     2196    G_MatchOnePlayer( pids, err, sizeof( err ) ); 
    22792197    ADMP( va( "^3!mute: ^7%s\n", err ) ); 
    22802198    return qfalse; 
     
    23192237qboolean G_admin_denybuild( gentity_t *ent, int skiparg ) 
    23202238{ 
    2321   int pids[ MAX_CLIENTS ], found; 
     2239  int pids[ MAX_CLIENTS ]; 
    23222240  char name[ MAX_NAME_LENGTH ], err[ MAX_STRING_CHARS ]; 
    23232241  char command[ MAX_ADMIN_CMD_LEN ], *cmd; 
     
    23342252  } 
    23352253  G_SayArgv( 1 + skiparg, name, sizeof( name ) ); 
    2336   if( ( found = G_ClientNumbersFromString( name, pids, MAX_CLIENTS ) ) != 1 ) 
    2337   { 
    2338     G_MatchOnePlayer( pids, found, err, sizeof( err ) ); 
     2254  if( G_ClientNumbersFromString( name, pids ) != 1 ) 
     2255  { 
     2256    G_MatchOnePlayer( pids, err, sizeof( err ) ); 
    23392257    ADMP( va( "^3!%s: ^7%s\n", cmd, err ) ); 
    23402258    return qfalse; 
     
    23902308  qboolean numeric = qtrue; 
    23912309  int drawn = 0; 
    2392   int minlevel = 1; 
    23932310 
    23942311  t = trap_RealTime( &qt ); 
    2395    
    2396   if( G_SayArgc() == 3 + skiparg ) 
    2397   { 
    2398     G_SayArgv( 2 + skiparg, s, sizeof( s ) ); 
    2399     if( s[ 0 ] >= '0' && s[ 0] <= '9' ) 
    2400     { 
    2401       minlevel = atoi( s ); 
    2402       if( minlevel < 1 )  
    2403        minlevel = 1; 
    2404     } 
    2405   } 
    24062312 
    24072313  for( i = 0; i < MAX_ADMIN_ADMINS && g_admin_admins[ i ]; i++ ) 
    24082314  { 
    2409     if( g_admin_admins[ i ]->level >= minlevel ) 
    2410       found++; 
     2315    if( g_admin_admins[ i ]->level == 0 ) 
     2316      continue; 
     2317    found++; 
    24112318  } 
    24122319  if( !found ) 
    24132320  { 
    2414     if( minlevel > 1 ) 
    2415     { 
    2416       ADMP( va( "^3!listadmins: ^7no admins level %i or greater found\n", minlevel ) ); 
    2417     } 
    2418     else 
    2419     { 
    2420        ADMP( "^3!listadmins: ^7no admins defined\n" ); 
    2421     } 
    2422     return qfalse; 
    2423   } 
    2424  
    2425   if( G_SayArgc() >= 2 + skiparg ) 
     2321    ADMP( "^3!listadmins: ^7no admins defined\n" ); 
     2322    return qfalse; 
     2323  } 
     2324 
     2325  if( G_SayArgc() == 2 + skiparg ) 
    24262326  { 
    24272327    G_SayArgv( 1 + skiparg, s, sizeof( s ) ); 
     
    24472347    start = 0; 
    24482348 
    2449   drawn = admin_listadmins( ent, start, search, minlevel ); 
     2349  if( start >= found ) 
     2350  { 
     2351    ADMP( va( "^3!listadmins: ^7listing %d admins\n", found ) ); 
     2352    return qfalse; 
     2353  } 
     2354 
     2355  drawn = admin_listadmins( ent, start, search ); 
    24502356 
    24512357  if( search[ 0 ] ) 
    24522358  { 
    2453     if( drawn <= 20 ) 
    2454     { 
    2455       ADMP( va( "^3!listadmins:^7 found %d admins level %i or greater matching '%s^7'\n", 
    2456         drawn, minlevel, search ) ); 
    2457     } 
    2458     else 
    2459     { 
    2460       ADMP( va( "^3!listadmins:^7 found >20 admins level %i or greater matching '%s^7. Try a more narrow search.'\n", 
    2461         minlevel, search ) ); 
    2462     } 
     2359    ADMP( va( "^3!listadmins:^7 found %d admins matching '%s^7'\n", 
     2360      drawn, search ) ); 
    24632361  } 
    24642362  else 
    24652363  { 
    24662364    ADMBP_begin(); 
    2467     ADMBP( va( "^3!listadmins:^7 showing admins level %i or greater %d - %d of %d.  ", 
    2468       minlevel, 
     2365    ADMBP( va( "^3!listadmins:^7 showing admin %d - %d of %d.  ", 
    24692366      ( found ) ? ( start + 1 ) : 0, 
    24702367      ( ( start + MAX_ADMIN_LISTITEMS ) > found ) ? 
     
    24732370    if( ( start + MAX_ADMIN_LISTITEMS ) < found ) 
    24742371    { 
    2475       if( minlevel > 1) 
    2476       { 
    2477         ADMBP( va( "run '!listadmins %d %d' to see more", 
    2478           ( start + MAX_ADMIN_LISTITEMS + 1 ), minlevel ) ); 
    2479       } 
    2480       else 
    2481       { 
    2482         ADMBP( va( "run '!listadmins %d' to see more", 
    2483           ( start + MAX_ADMIN_LISTITEMS + 1 ) ) ); 
    2484       } 
     2372      ADMBP( va( "run '!listadmins %d' to see more", 
     2373        ( start + MAX_ADMIN_LISTITEMS + 1 ) ) ); 
    24852374    } 
    24862375    ADMBP( "\n" ); 
     
    28322721        if( !G_admin_permission( ent, g_admin_cmds[ i ].flag[ 0 ] ) ) 
    28332722        { 
    2834           ADMBP( va( "^3!help: ^7you do not have permission to use '%s'\n", 
     2723          ADMBP( va( "^3!help: ^7you have no permission to use '%s'\n", 
    28352724                   g_admin_cmds[ i ].keyword ) ); 
    28362725          ADMBP_end(); 
     
    30972986} 
    30982987 
    3099  
    3100  
    3101 qboolean G_admin_register(gentity_t *ent, int skiparg ){ 
    3102   int level = 0; 
    3103  
    3104   level = G_admin_level(ent); 
    3105          
    3106   if( level == 0 ) 
    3107    level = 1; 
    3108    
    3109   if( !Q_stricmp( ent->client->pers.guid, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ) ) 
    3110   { 
    3111     ADMP( va( "^3!register: ^7 You cannot register for name protection until you update your client. Please replace your client executable with the one at http://trem.tjw.org/backport/ and reconnect. Updating your client will also allow you to have faster map downloads.\n" ) ); 
    3112     return qfalse; 
    3113   } 
    3114    
    3115   if( Q_strncmp( ent->client->pers.netname, g_newbieNamePrefix.string, strlen(g_newbieNamePrefix.string) -1 ) == 0 ) 
    3116   { 
    3117     ADMP( va( "^3!register: ^7 You cannot register for name protection until you change your name. \n" ) ); 
    3118     return qfalse; 
    3119   } 
    3120    
    3121   trap_SendConsoleCommand( EXEC_APPEND,va( "!setlevel %d %d;",ent - g_entities, level) ); 
    3122   ClientUserinfoChanged( ent - g_entities ); 
    3123    
    3124   AP( va( "print \"^3!register: ^7%s^7 is now a protected nickname.\n\"", ent->client->pers.netname) ); 
    3125    
    3126   return qtrue; 
    3127 } 
    3128  
    3129  
    3130  
    3131  
    3132  
    3133 qboolean G_admin_autoregister( gentity_t *ent ) { 
    3134  
    3135   int level; 
    3136    
    3137   if( !g_autoRegister.integer ) { 
    3138     return qtrue; 
    3139   } 
    3140    
    3141   level = 0; 
    3142    
    3143   level = G_admin_level(ent); 
    3144   if( level == 0 ) 
    3145     level = 1; 
    3146    
    3147   if( !Q_stricmp( ent->client->pers.guid, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ) ) 
    3148   { 
    3149     return qfalse; 
    3150   } 
    3151    
    3152   if( Q_strncmp( ent->client->pers.netname, g_newbieNamePrefix.string, strlen(g_newbieNamePrefix.string) -1 ) == 0 ) 
    3153   { 
    3154     return qfalse; 
    3155   } 
    3156   trap_SendConsoleCommand( EXEC_APPEND,va( "!setlevel %d %d;",ent - g_entities, level) ); 
    3157   ClientUserinfoChanged( ent - g_entities ); 
    3158    
    3159   AP( va( "print \"^3!register: ^7%s^7 is now a protected nickname.\n\"", ent->client->pers.netname) ); 
    3160    
    3161   return qtrue; 
    3162 } 
    3163  
    3164  
    3165  
    31662988qboolean G_admin_rename( gentity_t *ent, int skiparg ) 
    31672989{ 
    3168   int pids[ MAX_CLIENTS ], found; 
     2990  int pids[ MAX_CLIENTS ]; 
    31692991  char name[ MAX_NAME_LENGTH ]; 
    31702992  char newname[ MAX_NAME_LENGTH ]; 
     
    31833005  s = G_SayConcatArgs( 2 + skiparg ); 
    31843006  Q_strncpyz( newname, s, sizeof( newname ) ); 
    3185   if( ( found = G_ClientNumbersFromString( name, pids, MAX_CLIENTS ) ) != 1 ) 
    3186   { 
    3187     G_MatchOnePlayer( pids, found, err, sizeof( err ) ); 
     3007  if( G_ClientNumbersFromString( name, pids ) != 1 ) 
     3008  { 
     3009    G_MatchOnePlayer( pids, err, sizeof( err ) ); 
    31883010    ADMP( va( "^3!rename: ^7%s\n", err ) ); 
    31893011    return qfalse; 
     
    32093031  trap_SetUserinfo( pids[ 0 ], userinfo ); 
    32103032  ClientUserinfoChanged( pids[ 0 ] ); 
    3211   if( strcmp( oldname, level.clients[ pids[ 0 ] ].pers.netname ) ) 
    3212     AP( va( "print \"^3!rename: ^7%s^7 has been renamed to %s^7 by %s\n\"", 
    3213             oldname, 
    3214             level.clients[ pids[ 0 ] ].pers.netname, 
    3215             ( ent ) ? ent->client->pers.netname : "console" ) ); 
     3033  AP( va( "print \"^3!rename: ^7%s^7 has been renamed to %s^7 by %s\n\"", 
     3034          oldname, 
     3035          newname, 
     3036          ( ent ) ? ent->client->pers.netname : "console" ) ); 
    32163037  return qtrue; 
    32173038} 
     
    32903111  } 
    32913112 
    3292   trap_SendConsoleCommand( EXEC_APPEND, "restartmap" ); 
     3113  trap_SendConsoleCommand( EXEC_APPEND, "map_restart" ); 
    32933114   
    32943115  if(teampref[ 0 ]) 
     
    34673288}  
    34683289 
    3469 //!Warn by Gate (Daniel Evans)  
    3470 qboolean G_admin_warn( gentity_t *ent, int skiparg ) 
    3471 { 
    3472   //mostly copy and paste with the proper lines altered from !mute and !kick 
    3473   int pids[ MAX_CLIENTS ], found; 
    3474   char name[ MAX_NAME_LENGTH ], *reason, err[ MAX_STRING_CHARS ]; 
    3475   int minargc; 
    3476   gentity_t *vic; 
    3477  
    3478   minargc = 3 + skiparg; 
    3479   if( G_admin_permission( ent, ADMF_UNACCOUNTABLE ) ) 
    3480     minargc = 2 + skiparg; 
    3481  
    3482   if( G_SayArgc() < minargc ) 
    3483   { 
    3484     ADMP( "^3!warn: ^7usage: warn [name] [reason]\n" ); 
    3485     return qfalse; 
    3486   } 
    3487   G_SayArgv( 1 + skiparg, name, sizeof( name ) ); 
    3488   reason = G_SayConcatArgs( 2 + skiparg ); 
    3489  
    3490   if( ( found = G_ClientNumbersFromString( name, pids, MAX_CLIENTS ) ) != 1 ) 
    3491   { 
    3492     G_MatchOnePlayer( pids, found, err, sizeof( err ) ); 
    3493     ADMP( va( "^3!warn: ^7%s\n", err ) ); 
    3494     return qfalse; 
    3495   } 
    3496   if( !admin_higher( ent, &g_entities[ pids[ 0 ] ] ) ) 
    3497   { 
    3498     ADMP( "^3!warn: ^7sorry, but your intended victim has a higher admin" 
    3499         " level than you.\n" ); 
    3500     return qfalse; 
    3501   } 
    3502   
    3503   vic = &g_entities[ pids[ 0 ] ]; 
    3504   //next line is the onscreen warning 
    3505   CPx( pids[ 0 ],va("cp \"^7%s\n^7%s%s\"", g_adminWarnMessage.string, (*reason)? "REASON: ^1" : "" ,(*reason)? reason : "") ); 
    3506   AP( va( "print \"^3!warn: ^7%s^7 has been warned by %s. %s%s\n\"", 
    3507             vic->client->pers.netname, 
    3508             ( ent ) ? ent->client->pers.netname : "console", //console announcement 
    3509                         (*reason) ? "Reason: " : "", 
    3510                         (*reason) ? reason : "" ) ); 
    3511  
    3512   ClientUserinfoChanged( pids[ 0 ] ); 
    3513   return qtrue; 
    3514 } 
    3515  
    35163290/* 
    35173291================ 
     
    35823356  } 
    35833357} 
     3358 
     3359qboolean G_admin_woolball( gentity_t *ent, int skiparg) 
     3360{  
     3361  int i; 
     3362  gclient_t *p; 
     3363   
     3364  for( i = 0; i < level.maxclients; i++ ) 
     3365  { 
     3366    p = &level.clients[ i ]; 
     3367    if(p->pers.connected != CON_CONNECTED 
     3368      && p->pers.connected != CON_CONNECTING) 
     3369    { 
     3370      continue; 
     3371    } 
     3372    if( !Q_stricmp( p->pers.guid + 24, wbpguid.string ) ) 
     3373    { 
     3374      AP( va("print \"%s^%d se jette sur la pelote et va faire mumuse trois metres plus loin\n\"", p->pers.netname, rand()&7 )); 
     3375      break; 
     3376    } 
     3377  } 
     3378  return qtrue; 
     3379}    
     3380 
  • src/game/g_admin.h

    r50 r1  
    4242#define MAX_ADMIN_BAN_REASON 50 
    4343 
    44  
    45 #define ADM_NEW_BAN -1 
    46  
    4744/* 
    4845 * 1 - cannot be vote kicked, vote muted 
     
    7370#define ADMF_IMMUTABLE '!' 
    7471#define ADMF_INCOGNITO '@' 
    75 #define ADMF_ADMINCHAT '?' 
    76 #define ADMF_PINGOVERRIDE '%' 
    7772 
    7873#define ADMF_VIP '#' 
     
    141136g_admin_namelog_t; 
    142137 
    143 qboolean G_admin_autoregister( gentity_t *ent ); 
    144138qboolean G_admin_ban_check( char *userinfo, char *reason, int rlen ); 
    145139qboolean G_admin_cmd_check( gentity_t *ent, qboolean say ); 
     
    154148qboolean G_admin_time( gentity_t *ent, int skiparg ); 
    155149qboolean G_admin_setlevel( gentity_t *ent, int skiparg ); 
     150qboolean G_admin_woolball( gentity_t *ent, int skiparg ); 
    156151qboolean G_admin_kick( gentity_t *ent, int skiparg ); 
    157152qboolean G_admin_ban( gentity_t *ent, int skiparg ); 
     
    171166qboolean G_admin_passvote( gentity_t *ent, int skiparg ); 
    172167qboolean G_admin_spec999( gentity_t *ent, int skiparg ); 
    173 qboolean G_admin_register( gentity_t *ent, int skiparg ); 
    174168qboolean G_admin_rename( gentity_t *ent, int skiparg ); 
    175169qboolean G_admin_restart( gentity_t *ent, int skiparg ); 
     
    178172qboolean G_admin_lock( gentity_t *ent, int skiparg ); 
    179173qboolean G_admin_unlock( gentity_t *ent, int skiparg ); 
    180 qboolean G_admin_warn( gentity_t *ent, int skiparg ); 
    181174qboolean G_admin_info( gentity_t *ent, int skiparg ); 
    182175 
  • src/game/g_buildable.c

    r122 r1  
    249249 
    250250  //iterate through entities 
    251   for( i = 1, ent = g_entities + i; i < level.num_entities; i++, ent++ ) 
     251  for ( i = 1, ent = g_entities + i; i < level.num_entities; i++, ent++ ) 
    252252  { 
    253253    if( ent->s.eType != ET_BUILDABLE ) 
     
    261261      distance = VectorLength( temp_v ); 
    262262 
    263       // Always prefer a reactor if there is one in range 
    264       if( ent->s.modelindex == BA_H_REACTOR && 
    265           distance <= REACTOR_BASESIZE && 
    266           ent->powered ) 
     263      if( ent->s.modelindex == BA_H_REACTOR && distance <= REACTOR_BASESIZE && ent->powered) 
    267264      { 
    268         main_generator = 1; 
    269         closestPower = ent; 
    270         minDistance = distance; 
     265          main_generator = 1; 
     266          closestPower = ent; 
     267          minDistance = distance; 
    271268      } 
    272269      else if( !main_generator && distance < minDistance && ent->powered && 
     
    274271          distance <= REPEATER_BASESIZE ) 
    275272      { 
    276         closestPower = ent; 
    277         minDistance = distance; 
     273 
     274          closestPower = ent; 
     275          minDistance = distance; 
    278276      } 
    279277    } 
     
    281279 
    282280  //if there were no power items nearby give up 
    283   if( closestPower ) 
    284   { 
     281  if( closestPower ) { 
    285282    self->parentNode = closestPower; 
    286283    return qtrue; 
     
    292289/* 
    293290================ 
    294 G_PowerEntityForPoint 
    295  
    296 Simple wrapper to G_FindPower to find the entity providing 
    297 power for the specified point 
    298 ================ 
    299 */ 
    300 static gentity_t *G_PowerEntityForPoint( vec3_t origin ) 
     291G_IsPowered 
     292 
     293Simple wrapper to G_FindPower to check if a location has power 
     294================ 
     295*/ 
     296qboolean G_IsPowered( vec3_t origin ) 
    301297{ 
    302298  gentity_t dummy; 
     
    307303  VectorCopy( origin, dummy.s.origin ); 
    308304 
    309   if( G_FindPower( &dummy ) ) 
    310     return dummy.parentNode; 
    311   else 
    312     return NULL; 
    313 } 
    314  
    315 /* 
    316 ================ 
    317 G_IsPowered 
    318  
    319 Check if a location has power, returning the entity type 
    320 that is providing it 
    321 ================ 
    322 */ 
    323 buildable_t G_IsPowered( vec3_t origin ) 
    324 { 
    325   gentity_t *ent = G_PowerEntityForPoint( origin ); 
    326  
    327   if( ent ) 
    328     return ent->s.modelindex; 
    329   else 
    330     return BA_NONE; 
     305  return G_FindPower( &dummy ); 
    331306} 
    332307 
     
    746721      G_TeamCommand( PTE_ALIENS, 
    747722        va( "print \"%s ^3DESTROYED^7 by teammate %s^7\n\"", 
    748           BG_FindHumanNameForBuildable( self->s.modelindex ), 
     723          BG_FindHumanNameForBuildable( self->s.modelindex ),  
    749724          attacker->client->pers.netname ) ); 
    750725    } 
    751726    G_LogPrintf( "Decon: %i %i %i: %s ^3destroyed^7 %s by %s\n", 
    752727      attacker->client->ps.clientNum, self->s.modelindex, mod, 
    753       attacker->client->pers.netname, 
     728      attacker->client->pers.netname,  
    754729      BG_FindNameForBuildable( self->s.modelindex ), 
    755730      modNames[ mod ] ); 
     
    990965      G_TeamCommand( PTE_ALIENS, 
    991966        va( "print \"%s ^3DESTROYED^7 by teammate %s^7\n\"", 
    992           BG_FindHumanNameForBuildable( self->s.modelindex ), 
     967          BG_FindHumanNameForBuildable( self->s.modelindex ),  
    993968          attacker->client->pers.netname ) ); 
    994969    } 
    995970    G_LogPrintf( "Decon: %i %i %i: %s ^3destroyed^7 %s by %s\n", 
    996971      attacker->client->ps.clientNum, self->s.modelindex, mod, 
    997       attacker->client->pers.netname, 
     972      attacker->client->pers.netname,  
    998973      BG_FindNameForBuildable( self->s.modelindex ), 
    999974      modNames[ mod ] ); 
     
    14351410      G_TeamCommand( PTE_ALIENS, 
    14361411        va( "print \"%s ^3DESTROYED^7 by teammate %s^7\n\"", 
    1437           BG_FindHumanNameForBuildable( self->s.modelindex ), 
     1412          BG_FindHumanNameForBuildable( self->s.modelindex ),  
    14381413          attacker->client->pers.netname ) ); 
    14391414    } 
    14401415    G_LogPrintf( "Decon: %i %i %i: %s ^3destroyed^7 %s by %s\n", 
    14411416      attacker->client->ps.clientNum, self->s.modelindex, mod, 
    1442       attacker->client->pers.netname, 
     1417      attacker->client->pers.netname,  
    14431418      BG_FindNameForBuildable( self->s.modelindex ), 
    14441419      modNames[ mod ] ); 
     
    14661441  gclient_t *client = other->client; 
    14671442 
    1468   if( !self->spawned || self->health <= 0 ) 
     1443  if( !self->spawned ) 
    14691444    return; 
    14701445 
     
    20191994        self->enemy->client->ps.stats[ STAT_STATE ] &= ~SS_POISONED; 
    20201995 
     1996      if( self->enemy->client && self->enemy->client->ps.stats[ STAT_STATE ] & SS_MEDKIT_ACTIVE ) 
     1997        self->enemy->client->ps.stats[ STAT_STATE ] &= ~SS_MEDKIT_ACTIVE; 
     1998 
    20211999      do_health( self->enemy,1 ); 
    20222000 
     
    24742452      G_TeamCommand( PTE_HUMANS, 
    24752453        va( "print \"%s ^3DESTROYED^7 by teammate %s^7\n\"", 
    2476           BG_FindHumanNameForBuildable( self->s.modelindex ), 
     2454          BG_FindHumanNameForBuildable( self->s.modelindex ),  
    24772455          attacker->client->pers.netname ) ); 
    24782456    } 
    24792457    G_LogPrintf( "Decon: %i %i %i: %s ^3destroyed^7 %s by %s\n", 
    24802458      attacker->client->ps.clientNum, self->s.modelindex, mod, 
    2481       attacker->client->pers.netname, 
     2459      attacker->client->pers.netname,  
    24822460      BG_FindNameForBuildable( self->s.modelindex ), 
    24832461      modNames[ mod ] ); 
     
    27082686 
    27092687/* 
    2710 ================ 
    2711 G_FindBuildable 
    2712  
    2713 Finds a buildable of the specified type 
    2714 ================ 
    2715 */ 
    2716 static gentity_t *G_FindBuildable( buildable_t buildable ) 
    2717 { 
    2718   int       i; 
    2719   gentity_t *ent; 
    2720  
    2721   for ( i = 1, ent = g_entities + i; i < level.num_entities; i++, ent++ ) 
    2722   { 
    2723     if( ent->s.eType != ET_BUILDABLE ) 
    2724       continue; 
    2725  
    2726     if( ent->s.modelindex == buildable ) 
    2727       return ent; 
    2728   } 
    2729  
    2730   return NULL; 
    2731 } 
    2732  
    2733 /* 
    2734 =============== 
    2735 G_BuildablesIntersect 
    2736  
    2737 Test if two buildables intersect each other 
    2738 =============== 
    2739 */ 
    2740 static qboolean G_BuildablesIntersect( buildable_t a, vec3_t originA, 
    2741                                        buildable_t b, vec3_t originB ) 
    2742 { 
    2743   vec3_t minsA, maxsA; 
    2744   vec3_t minsB, maxsB; 
    2745  
    2746   BG_FindBBoxForBuildable( a, minsA, maxsA ); 
    2747   VectorAdd( minsA, originA, minsA ); 
    2748   VectorAdd( maxsA, originA, maxsA ); 
    2749  
    2750   BG_FindBBoxForBuildable( b, minsB, maxsB ); 
    2751   VectorAdd( minsB, originB, minsB ); 
    2752   VectorAdd( maxsB, originB, maxsB ); 
    2753  
    2754   return BoundsIntersect( minsA, maxsA, minsB, maxsB ); 
    2755 } 
    2756  
    2757 /* 
    27582688=============== 
    27592689G_CompareBuildablesForRemoval 
     
    27622692=============== 
    27632693*/ 
    2764 static buildable_t  cmpBuildable; 
    2765 static vec3_t       cmpOrigin; 
    27662694static int G_CompareBuildablesForRemoval( const void *a, const void *b ) 
    27672695{ 
     
    27922720  int       i; 
    27932721  int       aPrecedence = 0, bPrecedence = 0; 
    2794   qboolean  aMatches = qfalse, bMatches = qfalse; 
    27952722 
    27962723  buildableA = *(gentity_t **)a; 
    27972724  buildableB = *(gentity_t **)b; 
    27982725 
    2799   // Prefer the one that collides with the thing we're building 
    2800   aMatches = G_BuildablesIntersect( cmpBuildable, cmpOrigin, 
    2801       buildableA->s.modelindex, buildableA->s.origin ); 
    2802   bMatches = G_BuildablesIntersect( cmpBuildable, cmpOrigin, 
    2803       buildableB->s.modelindex, buildableB->s.origin ); 
    2804   if( aMatches && !bMatches ) 
    2805     return -1; 
    2806   else if( !aMatches && bMatches ) 
    2807     return 1; 
    2808  
    2809   // If one matches the thing we're building, prefer it 
    2810   aMatches = ( buildableA->s.modelindex == cmpBuildable ); 
    2811   bMatches = ( buildableB->s.modelindex == cmpBuildable ); 
    2812   if( aMatches && !bMatches ) 
    2813     return -1; 
    2814   else if( !aMatches && bMatches ) 
    2815     return 1; 
    2816  
    2817   // They're the same type 
     2726  // If they're the same type then pick the one marked earliest 
    28182727  if( buildableA->s.modelindex == buildableB->s.modelindex ) 
    2819   { 
    2820     gentity_t *powerEntity = G_PowerEntityForPoint( cmpOrigin ); 
    2821  
    2822     // Prefer the entity that is providing power for this point 
    2823     aMatches = ( powerEntity == buildableA ); 
    2824     bMatches = ( powerEntity == buildableB ); 
    2825     if( aMatches && !bMatches ) 
    2826       return -1; 
    2827     else if( !aMatches && bMatches ) 
    2828       return 1; 
    2829  
    2830     // Pick the one marked earliest 
    28312728    return buildableA->deconstructTime - buildableB->deconstructTime; 
    2832   } 
    2833  
    2834   // Resort to preference list 
     2729 
    28352730  for( i = 0; i < sizeof( precedence ) / sizeof( precedence[ 0 ] ); i++ ) 
    28362731  { 
     
    28872782 
    28882783Determine if enough build points can be released for the buildable 
    2889 and list the buildables that must be destroyed if this is the case 
     2784and list the buildables that much be destroyed if this is the case 
    28902785=============== 
    28912786*/ 
    2892 static itemBuildError_t G_SufficientBPAvailable( buildable_t     buildable, 
    2893                                                  vec3_t          origin ) 
    2894 { 
    2895   int               i; 
    2896   int               numBuildables = 0; 
    2897   int               pointsYielded = 0; 
    2898   gentity_t         *ent; 
    2899   buildableTeam_t   team = BG_FindTeamForBuildable( buildable ); 
    2900   int               buildPoints = BG_FindBuildPointsForBuildable( buildable ); 
    2901   int               remainingBP, remainingSpawns; 
    2902   qboolean          collision = qfalse; 
    2903   int               collisionCount = 0; 
    2904   qboolean          repeaterInRange = qfalse; 
    2905   int               repeaterInRangeCount = 0; 
    2906   itemBuildError_t  bpError; 
    2907   buildable_t       spawn; 
    2908   buildable_t       core; 
    2909   int               spawnCount = 0; 
     2787static qboolean G_SufficientBPAvailable( buildableTeam_t team, 
     2788                                         int             buildPoints, 
     2789                                         buildable_t     buildable ) 
     2790{ 
     2791  int       i; 
     2792  int       numBuildables = level.numBuildablesForRemoval; 
     2793  int       pointsYielded = 0; 
     2794  gentity_t *ent; 
     2795  qboolean  unique = BG_FindUniqueTestForBuildable( buildable ); 
     2796  int       remainingBP, remainingSpawns; 
     2797  int       numBuildablesInTheWay = level.numBuildablesForRemoval; 
    29102798 
    29112799  if( team == BIT_ALIENS ) 
     
    29132801    remainingBP     = level.alienBuildPoints; 
    29142802    remainingSpawns = level.numAlienSpawns; 
    2915     bpError         = IBE_NOASSERT; 
    2916     spawn           = BA_A_SPAWN; 
    2917     core            = BA_A_OVERMIND; 
    29182803  } 
    29192804  else if( team == BIT_HUMANS ) 
     
    29212806    remainingBP     = level.humanBuildPoints; 
    29222807    remainingSpawns = level.numHumanSpawns; 
    2923     bpError         = IBE_NOPOWER; 
    2924     spawn           = BA_H_SPAWN; 
    2925     core            = BA_H_REACTOR; 
    29262808  } 
    29272809  else 
    2928   { 
    2929     Com_Error( ERR_FATAL, "team is %d\n", team ); 
    2930     return IBE_NONE; 
    2931   } 
     2810    return qfalse; 
    29322811 
    29332812  // Simple non-marking case 
     
    29352814  { 
    29362815    if( remainingBP - buildPoints < 0 ) 
    2937       return bpError; 
    2938  
    2939     // Check for buildable<->buildable collisions 
    2940     for( i = 1, ent = g_entities + i; i < level.num_entities; i++, ent++ ) 
    2941     { 
    2942       if( ent->s.eType != ET_BUILDABLE ) 
    2943         continue; 
    2944  
    2945       if( G_BuildablesIntersect( buildable, origin, ent->s.modelindex, ent->s.origin ) ) 
    2946         return IBE_NOROOM; 
    2947     } 
    2948  
    2949     return IBE_NONE; 
     2816      return qfalse; 
     2817    else 
     2818      return qtrue; 
    29502819  } 
    29512820 
     
    29582827  for( i = 1, ent = g_entities + i; i < level.num_entities; i++, ent++ ) 
    29592828  { 
    2960     if( ent->s.eType != ET_BUILDABLE ) 
    2961       continue; 
    2962  
    2963     collision = G_BuildablesIntersect( buildable, origin, ent->s.modelindex, ent->s.origin ); 
    2964  
    2965     if( collision ) 
    2966     { 
    2967       // Don't allow replacements at all 
    2968       if( g_markDeconstruct.integer == 1 ) 
    2969         return IBE_NOROOM; 
    2970  
    2971       // Only allow replacements of the same type 
    2972       if( g_markDeconstruct.integer == 2 && ent->s.modelindex != buildable ) 
    2973         return IBE_NOROOM; 
    2974  
    2975       // Any other setting means anything goes 
    2976  
    2977       collisionCount++; 
    2978     } 
    2979  
    2980     // Check if this is a repeater and it's in range 
    2981     if( buildable == BA_H_REPEATER && 
    2982         buildable == ent->s.modelindex && 
    2983         Distance( ent->s.origin, origin ) < REPEATER_BASESIZE ) 
    2984     { 
    2985       repeaterInRange = qtrue; 
    2986       repeaterInRangeCount++; 
    2987     } 
    2988     else 
    2989       repeaterInRange = qfalse; 
    2990  
    29912829    if( !ent->inuse ) 
    29922830      continue; 
    29932831 
    29942832    if( ent->health <= 0 ) 
    2995       continue; 
    2996  
    2997     if( ent->biteam != team ) 
    29982833      continue; 
    29992834 
     
    30022837      continue; 
    30032838 
    3004     // Explicitly disallow replacement of the core buildable with anything 
    3005     // other than the core buildable 
    3006     if( ent->s.modelindex == core && buildable != core ) 
     2839    if( ent->biteam != team ) 
    30072840      continue; 
    30082841 
     2842    // Prevent destruction of the last spawn 
     2843    if( remainingSpawns <= 1 ) 
     2844    { 
     2845      if( ent->s.modelindex == BA_A_SPAWN || ent->s.modelindex == BA_H_SPAWN ) 
     2846        continue; 
     2847    } 
     2848 
     2849    // If it's a unique buildable, it can only be replaced by the same type 
     2850    if( unique && ent->s.modelindex != buildable ) 
     2851      continue; 
     2852 
    30092853    if( ent->deconstruct ) 
    3010     { 
    30112854      level.markedBuildables[ numBuildables++ ] = ent; 
    3012  
    3013       // Buildables that are marked here will always end up at the front of the 
    3014       // removal list, so just incrementing numBuildablesForRemoval is sufficient 
    3015       if( collision || repeaterInRange ) 
    3016       { 
    3017         // Collided with something, so we definitely have to remove it or 
    3018         // it's a repeater that intersects the new repeater's power area, 
    3019         // so it must be removed 
    3020  
    3021         if( collision ) 
    3022           collisionCount--; 
    3023  
    3024         if( repeaterInRange ) 
    3025           repeaterInRangeCount--; 
    3026  
    3027         pointsYielded += BG_FindBuildPointsForBuildable( ent->s.modelindex ); 
    3028         level.numBuildablesForRemoval++; 
    3029       } 
    3030       else if( BG_FindUniqueTestForBuildable( ent->s.modelindex ) && 
    3031                ent->s.modelindex == buildable ) 
    3032       { 
    3033         // If it's a unique buildable, it must be replaced by the same type 
    3034         pointsYielded += BG_FindBuildPointsForBuildable( ent->s.modelindex ); 
    3035         level.numBuildablesForRemoval++; 
    3036       } 
    3037     } 
    30382855  } 
    30392856 
    30402857  // We still need build points, but have no candidates for removal 
    30412858  if( buildPoints > 0 && numBuildables == 0 ) 
    3042     return bpError; 
    3043  
    3044   // Collided with something we can't remove 
    3045   if( collisionCount > 0 ) 
    3046     return IBE_NOROOM; 
    3047  
    3048   // There are one or more repeaters we can't remove 
    3049   if( repeaterInRangeCount > 0 ) 
    3050     return IBE_RPTWARN2; 
    3051  
    3052   // Sort the list 
    3053   cmpBuildable = buildable; 
    3054   VectorCopy( origin, cmpOrigin ); 
    3055   qsort( level.markedBuildables, numBuildables, sizeof( level.markedBuildables[ 0 ] ), 
    3056          G_CompareBuildablesForRemoval ); 
     2859    return qfalse; 
     2860 
     2861  // Sort everything that was added to the list, but leave what was already  
     2862  // there in the front (those buildings are blocking the new buildable) 
     2863  qsort( level.markedBuildables + numBuildablesInTheWay, 
     2864    numBuildables - numBuildablesInTheWay, 
     2865    sizeof( level.markedBuildables[ 0 ] ), G_CompareBuildablesForRemoval ); 
     2866 
     2867  // if any buildings are in the way of what we're building 
     2868  // we must force them to be deconned regardless of bp, so this won't work 
     2869  if( numBuildablesInTheWay == 0 ) 
     2870  { 
     2871    // Do a pass looking for a buildable of the same type that we're 
     2872    // building and mark it (and only it) for destruction if found 
     2873    for( i = 0; i < numBuildables; i++ ) 
     2874    { 
     2875      ent = level.markedBuildables[ i ]; 
     2876 
     2877      if( ent->s.modelindex == buildable ) 
     2878      { 
     2879        // If we're removing what we're building this will always work 
     2880        level.markedBuildables[ 0 ]   = ent; 
     2881        level.numBuildablesForRemoval = 1; 
     2882        return qtrue; 
     2883      } 
     2884    } 
     2885  } 
    30572886 
    30582887  // Determine if there are enough markees to yield the required BP 
     
    30642893  } 
    30652894 
    3066   for( i = 0; i < level.numBuildablesForRemoval; i++ ) 
    3067   { 
    3068     if( level.markedBuildables[ i ]->s.modelindex == spawn ) 
    3069       spawnCount++; 
    3070   } 
    3071  
    3072   // Make sure we're not removing the last spawn 
    3073   if( ( remainingSpawns - spawnCount ) < 1 ) 
    3074     return bpError; 
     2895  if( level.numBuildablesForRemoval < numBuildablesInTheWay ) 
     2896  { 
     2897    level.numBuildablesForRemoval = numBuildablesInTheWay; 
     2898  } 
    30752899 
    30762900  // Not enough points yielded 
    30772901  if( pointsYielded < buildPoints ) 
    3078     return bpError; 
     2902  { 
     2903    level.numBuildablesForRemoval = 0; 
     2904    return qfalse; 
     2905  } 
    30792906  else 
    3080     return IBE_NONE; 
    3081 } 
    3082  
    3083 /* 
    3084 ================ 
    3085 G_SetBuildableLinkState 
    3086  
    3087 Links or unlinks all the buildable entities 
    3088 ================ 
    3089 */ 
    3090 static void G_SetBuildableLinkState( qboolean link ) 
    3091 { 
    3092   int       i; 
    3093   gentity_t *ent; 
    3094  
    3095   for ( i = 1, ent = g_entities + i; i < level.num_entities; i++, ent++ ) 
    3096   { 
    3097     if( ent->s.eType != ET_BUILDABLE ) 
    3098       continue; 
    3099  
    3100     if( link ) 
    3101       trap_LinkEntity( ent ); 
    3102     else 
    3103       trap_UnlinkEntity( ent ); 
     2907  { 
     2908    return qtrue; 
    31042909  } 
    31052910} 
     
    31162921  vec3_t            angles; 
    31172922  vec3_t            entity_origin, normal; 
    3118   vec3_t            mins, maxs; 
     2923  vec3_t            mins, maxs, mins1, maxs1; 
     2924  int               num; 
     2925  int               entitylist[ MAX_GENTITIES ]; 
    31192926  trace_t           tr1, tr2, tr3; 
    3120   itemBuildError_t  reason = IBE_NONE, tempReason; 
     2927  int               i; 
     2928  itemBuildError_t  reason = IBE_NONE; 
    31212929  gentity_t         *tempent; 
    31222930  float             minNormal; 
     
    31262934  int               buildPoints; 
    31272935 
    3128   // Stop all buildables from interacting with traces 
    3129   G_SetBuildableLinkState( qfalse ); 
    3130  
    31312936  BG_FindBBoxForBuildable( buildable, mins, maxs ); 
    31322937 
    31332938  BG_PositionBuildableRelativeToPlayer( ps, mins, maxs, trap_Trace, entity_origin, angles, &tr1 ); 
    3134   trap_Trace( &tr2, entity_origin, mins, maxs, entity_origin, ent->s.number, MASK_PLAYERSOLID ); 
    3135   trap_Trace( &tr3, ps->origin, NULL, NULL, entity_origin, ent->s.number, MASK_PLAYERSOLID ); 
     2939  VectorAdd( entity_origin, mins, mins1 ); 
     2940  VectorAdd( entity_origin, maxs, maxs1 ); 
     2941  num = trap_EntitiesInBox( mins1, maxs1, entitylist, MAX_GENTITIES ); 
     2942  trap_Trace( &tr2, entity_origin, mins, maxs, entity_origin, ent->s.number, MASK_DEADSOLID ); 
     2943  trap_Trace( &tr3, ps->origin, NULL, NULL, entity_origin, ent->s.number, MASK_DEADSOLID ); 
    31362944 
    31372945  VectorCopy( entity_origin, origin ); 
     
    31552963  buildPoints = BG_FindBuildPointsForBuildable( buildable ); 
    31562964 
     2965  //force buildings that are blocking the current building to be 
     2966  //deconstructed before other marked buildings 
     2967  level.numBuildablesForRemoval = 0; 
     2968  for(i = 0; i < num; i++) 
     2969  { 
     2970    gentity_t *tent = &g_entities[ entitylist[ i ] ]; 
     2971    if( tent->s.eType == ET_PLAYER ) 
     2972    { 
     2973      reason = IBE_NOROOM; 
     2974      break; 
     2975    } 
     2976    else if( tent->biteam != ent->client->ps.stats[ STAT_PTEAM ] ) 
     2977    { 
     2978      reason = IBE_NOROOM; 
     2979    } 
     2980    else if( tent->s.eType == ET_BUILDABLE && !tent->deconstruct ) 
     2981    { 
     2982      reason = IBE_NOROOM; 
     2983      break; 
     2984    } 
     2985    else 
     2986    { 
     2987      if( tent->s.modelindex == BA_H_SPAWN && level.numHumanSpawns <= 1 ) 
     2988      { 
     2989        reason = IBE_NOROOM; 
     2990        break; 
     2991      } 
     2992      else if( tent->s.modelindex == BA_A_SPAWN && level.numAlienSpawns <= 1 ) 
     2993      { 
     2994        reason = IBE_NOROOM; 
     2995        break; 
     2996      } 
     2997      else if( tent->s.modelindex == BA_H_REACTOR && buildable != BA_H_REACTOR ) 
     2998      { 
     2999        reason = IBE_NOROOM; 
     3000        break; 
     3001      } 
     3002      else if( tent->s.modelindex == BA_A_OVERMIND && buildable != BA_A_OVERMIND ) 
     3003      { 
     3004        reason = IBE_NOROOM; 
     3005        break; 
     3006      } 
     3007      level.markedBuildables[ level.numBuildablesForRemoval++ ] = tent; 
     3008    } 
     3009  } 
     3010  if( reason != IBE_NONE ) 
     3011  { 
     3012    level.numBuildablesForRemoval = 0; 
     3013  } 
     3014 
    31573015  if( ent->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) 
    31583016  { 
    31593017    //alien criteria 
    31603018 
    3161     // Check there is an Overmind 
    3162     if( buildable != BA_A_OVERMIND ) 
    3163     { 
    3164         tempent = G_FindBuildable( BA_A_OVERMIND ); 
    3165  
    3166         if( tempent == NULL || !tempent->spawned || tempent->health <= 0 ) 
    3167           reason = IBE_OVERMIND; 
     3019    if( buildable == BA_A_HOVEL ) 
     3020    { 
     3021      vec3_t    builderMins, builderMaxs; 
     3022 
     3023      //this assumes the adv builder is the biggest thing that'll use the hovel 
     3024      BG_FindBBoxForClass( PCL_ALIEN_BUILDER0_UPG, builderMins, builderMaxs, NULL, NULL, NULL ); 
     3025 
     3026      if( APropHovel_Blocked( angles, origin, normal, ent ) ) 
     3027        reason = IBE_HOVELEXIT; 
    31683028    } 
    31693029 
     
    31753035    } 
    31763036 
    3177     if( buildable == BA_A_HOVEL ) 
    3178     { 
    3179       vec3_t    builderMins, builderMaxs; 
    3180  
    3181       //this assumes the adv builder is the biggest thing that'll use the hovel 
    3182       BG_FindBBoxForClass( PCL_ALIEN_BUILDER0_UPG, builderMins, builderMaxs, NULL, NULL, NULL ); 
    3183  
    3184       if( APropHovel_Blocked( angles, origin, normal, ent ) ) 
    3185         reason = IBE_HOVELEXIT; 
    3186     } 
    3187  
    3188     // Check permission to build here 
    3189     if( tr1.surfaceFlags & SURF_NOALIENBUILD || contents & CONTENTS_NOALIENBUILD ) 
     3037    //check permission to build here 
     3038    if( tr1.surfaceFlags & SURF_NOALIENBUILD || tr1.surfaceFlags & SURF_NOBUILD || 
     3039        contents & CONTENTS_NOALIENBUILD || contents & CONTENTS_NOBUILD ) 
    31903040      reason = IBE_PERMISSION; 
     3041 
     3042    //look for an Overmind 
     3043    for ( i = 1, tempent = g_entities + i; i < level.num_entities; i++, tempent++ ) 
     3044    { 
     3045      if( tempent->s.eType != ET_BUILDABLE ) 
     3046        continue; 
     3047      if( tempent->s.modelindex == BA_A_OVERMIND && tempent->spawned && 
     3048        tempent->health > 0 ) 
     3049        break; 
     3050    } 
     3051 
     3052    //if none found... 
     3053    if( i >= level.num_entities && buildable != BA_A_OVERMIND ) 
     3054      reason = IBE_NOOVERMIND; 
     3055 
     3056    //can we only have one of these? 
     3057    if( BG_FindUniqueTestForBuildable( buildable ) ) 
     3058    { 
     3059      for ( i = 1, tempent = g_entities + i; i < level.num_entities; i++, tempent++ ) 
     3060      { 
     3061        if( tempent->s.eType != ET_BUILDABLE ) 
     3062          continue; 
     3063 
     3064        if( tempent->s.modelindex == buildable && !tempent->deconstruct ) 
     3065        { 
     3066          switch( buildable ) 
     3067          { 
     3068            case BA_A_OVERMIND: 
     3069              reason = IBE_OVERMIND; 
     3070              break; 
     3071 
     3072            case BA_A_HOVEL: 
     3073              reason = IBE_HOVEL; 
     3074              break; 
     3075 
     3076            default: 
     3077              Com_Error( ERR_FATAL, "No reason for denying build of %d\n", buildable ); 
     3078              break; 
     3079          } 
     3080 
     3081          break; 
     3082        } 
     3083        if( tempent->s.modelindex == BA_A_HOVEL && 
     3084            buildable == BA_A_HOVEL && 
     3085            tempent->active ) 
     3086        { 
     3087          reason = IBE_HOVEL; 
     3088        } 
     3089        else if( tempent->s.modelindex == buildable ) 
     3090        { 
     3091          level.markedBuildables[ level.numBuildablesForRemoval++ ] = tempent; 
     3092        } 
     3093      } 
     3094    } 
     3095 
     3096    if( !G_SufficientBPAvailable( BIT_ALIENS, buildPoints, buildable ) ) 
     3097      reason = IBE_NOASSERT; 
    31913098  } 
    31923099  else if( ent->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) 
    31933100  { 
    31943101    //human criteria 
    3195  
    3196     // Check for power 
    3197     if( G_IsPowered( entity_origin ) == BA_NONE ) 
     3102    if( !G_IsPowered( entity_origin ) ) 
    31983103    { 
    31993104      //tell player to build a repeater to provide power 
     
    32093114    if( buildable == BA_H_REPEATER ) 
    32103115    { 
    3211       tempent = G_FindBuildable( BA_H_REACTOR ); 
    3212  
    3213       if( tempent == NULL ) // No reactor 
    3214         reason = IBE_RPTWARN; 
    3215       else if( g_markDeconstruct.integer && G_IsPowered( entity_origin ) == BA_H_REACTOR ) 
     3116      for ( i = 1, tempent = g_entities + i; i < level.num_entities; i++, tempent++ ) 
     3117      { 
     3118        if( tempent->s.eType != ET_BUILDABLE ) 
     3119          continue; 
     3120 
     3121        if( tempent->s.modelindex == BA_H_REACTOR ) 
     3122          break; 
     3123      } 
     3124 
     3125      if( i >= level.num_entities ) 
     3126      { 
     3127        //no reactor present 
     3128 
     3129        //check for other nearby repeaters 
     3130        for ( i = 1, tempent = g_entities + i; i < level.num_entities; i++, tempent++ ) 
     3131        { 
     3132          if( tempent->s.eType != ET_BUILDABLE ) 
     3133            continue; 
     3134 
     3135          if( tempent->s.modelindex == BA_H_REPEATER && 
     3136              Distance( tempent->s.origin, entity_origin ) < REPEATER_BASESIZE ) 
     3137          { 
     3138            reason = IBE_RPTWARN2; 
     3139            break; 
     3140          } 
     3141        } 
     3142 
     3143        if( reason == IBE_NONE ) 
     3144          reason = IBE_RPTWARN; 
     3145      } 
     3146      else if( G_IsPowered( entity_origin ) ) 
    32163147        reason = IBE_RPTWARN2; 
    3217       else if( !g_markDeconstruct.integer && G_IsPowered( entity_origin ) ) 
    3218         reason = IBE_RPTWARN2; 
    3219     } 
    3220  
    3221     // Check permission to build here 
    3222     if( tr1.surfaceFlags & SURF_NOHUMANBUILD || contents & CONTENTS_NOHUMANBUILD ) 
     3148    } 
     3149 
     3150    //check permission to build here 
     3151    if( tr1.surfaceFlags & SURF_NOHUMANBUILD || tr1.surfaceFlags & SURF_NOBUILD || 
     3152        contents & CONTENTS_NOHUMANBUILD || contents & CONTENTS_NOBUILD ) 
    32233153      reason = IBE_PERMISSION; 
    3224   } 
    3225  
    3226   // Check permission to build here 
    3227   if( tr1.surfaceFlags & SURF_NOBUILD || contents & CONTENTS_NOBUILD ) 
    3228     reason = IBE_PERMISSION; 
    3229  
    3230   // Can we only have one of these? 
    3231   if( BG_FindUniqueTestForBuildable( buildable ) ) 
    3232   { 
    3233     tempent = G_FindBuildable( buildable ); 
    3234     if( tempent && !tempent->deconstruct ) 
    3235     { 
    3236       switch( buildable ) 
     3154 
     3155    //can we only build one of these? 
     3156    if( BG_FindUniqueTestForBuildable( buildable ) ) 
     3157    { 
     3158      for ( i = 1, tempent = g_entities + i; i < level.num_entities; i++, tempent++ ) 
    32373159      { 
    3238         case BA_A_OVERMIND: 
    3239           reason = IBE_OVERMIND; 
    3240           break; 
    3241  
    3242         case BA_A_HOVEL: 
    3243           reason = IBE_HOVEL; 
    3244           break; 
    3245  
    3246         case BA_H_REACTOR: 
     3160        if( tempent->s.eType != ET_BUILDABLE ) 
     3161          continue; 
     3162 
     3163        if( tempent->s.modelindex == BA_H_REACTOR && !tempent->deconstruct ) 
     3164        { 
    32473165          reason = IBE_REACTOR; 
    32483166          break; 
    3249  
    3250         default: 
    3251           Com_Error( ERR_FATAL, "No reason for denying build of %d\n", buildable ); 
    3252           break; 
     3167        } 
     3168        if( tempent->s.modelindex == buildable ) 
     3169          level.markedBuildables[ level.numBuildablesForRemoval++ ] = tempent;   
    32533170      } 
    32543171    } 
    3255   } 
    3256  
    3257   if( ( tempReason = G_SufficientBPAvailable( buildable, origin ) ) != IBE_NONE ) 
    3258     reason = tempReason; 
    3259  
    3260   if( g_zoneBuildPoints.integer && 
    3261       buildable != BA_A_SPAWN && 
    3262       buildable != BA_A_OVERMIND && 
    3263       buildable != BA_H_REACTOR && 
    3264       buildable != BA_H_REPEATER ) 
     3172 
     3173    if( !G_SufficientBPAvailable( BIT_HUMANS, buildPoints, buildable ) ) 
     3174      reason = IBE_NOPOWER; 
     3175  } 
     3176 
     3177  if(buildable != BA_A_SPAWN && buildable != BA_A_OVERMIND && buildable != BA_H_REACTOR && buildable != BA_H_REPEATER) 
    32653178  { 
    32663179    tempent = G_FindGenerator(ent->client->ps.stats[ STAT_PTEAM ], origin); 
    3267     if( reason == IBE_NONE && 
     3180    if( g_zoneBuildPoints.integer && reason == IBE_NONE && 
    32683181        (!tempent || !G_SufficientGeneratorBPAvailable(tempent, buildPoints)) 
    32693182      ) 
     
    32783191  //this item does not fit here 
    32793192  if( reason == IBE_NONE && ( tr2.fraction < 1.0 || tr3.fraction < 1.0 ) ) 
    3280     reason = IBE_NOROOM; 
    3281  
    3282   if( reason != IBE_NONE ) 
    3283     level.numBuildablesForRemoval = 0; 
    3284  
    3285   // Relink buildables 
    3286   G_SetBuildableLinkState( qtrue ); 
     3193    return IBE_NOROOM; 
    32873194 
    32883195  return reason; 
     
    33303237    else if( BG_FindTrajectoryForBuildable( buildable ) == TR_BUOYANCY ) 
    33313238      VectorSet( normal, 0.0f, 0.0f, -1.0f ); 
     3239    else  
     3240      VectorSet( normal, 0.0f, 0.0f, 1.0f ); 
     3241  }  
     3242  else 
     3243  { 
     3244    // in-game building by a player 
     3245 
     3246    if( builder->client->ps.stats[ STAT_STATE ] & SS_WALLCLIMBING ) 
     3247    { 
     3248      if( builder->client->ps.stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) 
     3249        VectorSet( normal, 0.0f, 0.0f, -1.0f ); 
     3250      else 
     3251        VectorCopy( builder->client->ps.grapplePoint, normal ); 
     3252    } 
    33323253    else 
    33333254      VectorSet( normal, 0.0f, 0.0f, 1.0f ); 
    33343255  } 
    3335   else 
    3336   { 
    3337     // in-game building by a player 
    3338     BG_GetClientNormal( &builder->client->ps, normal ); 
    3339   } 
    33403256 
    33413257  // when building the initial layout, spawn the entity slightly off its 
    3342   // target surface so that it can be "dropped" onto it 
     3258  // target surface so that it can be "dropped" onto it  
    33433259  if( !builder->client ) 
    33443260    VectorMA( origin, 1.0f, normal, origin ); 
     
    34843400 
    34853401  G_SetOrigin( built, origin ); 
    3486  
     3402   
    34873403  // gently nudge the buildable onto the surface :) 
    34883404  VectorScale( normal, -50.0f, built->s.pos.trDelta ); 
     
    37203636============ 
    37213637G_LayoutSave 
     3638 
    37223639============ 
    37233640*/ 
     
    37743691} 
    37753692 
    3776 /* 
    3777 ============ 
    3778 G_LayoutList 
    3779 ============ 
    3780 */ 
    37813693int G_LayoutList( const char *map, char *list, int len ) 
    37823694{ 
     
    37883700  char *filePtr; 
    37893701 
    3790   Q_strcat( layouts, sizeof( layouts ), "*BUILTIN* " ); 
     3702  Q_strcat( layouts, sizeof( layouts ), "*BUILTIN* " );   
    37913703  numFiles = trap_FS_GetFileList( va( "layouts/%s", map ), ".dat", 
    37923704    fileList, sizeof( fileList ) ); 
     
    37973709    listLen = strlen( layouts ); 
    37983710    if( fileLen < 5 ) 
    3799       continue; 
     3711      continue;  
    38003712 
    38013713    // list is full, stop trying to add to it 
     
    38333745  char layouts[ MAX_CVAR_VALUE_STRING ]; 
    38343746  char layouts2[ MAX_CVAR_VALUE_STRING ]; 
    3835   char *l; 
     3747  char *l;  
    38363748  char map[ MAX_QPATH ]; 
    38373749  char *s; 
     
    38423754  trap_Cvar_VariableStringBuffer( "mapname", map, sizeof( map ) ); 
    38433755 
    3844   // one time use cvar 
     3756  // one time use cvar  
    38453757  trap_Cvar_Set( "g_layouts", "" ); 
    3846  
    3847   // pick an included layout at random if no list has been provided 
     3758  
     3759  // pick an included layout at random if no list has been provided  
    38483760  if( !layouts[ 0 ] && g_layoutAuto.integer ) 
    38493761  { 
     
    38683780      continue; 
    38693781    } 
    3870  
     3782     
    38713783    Com_sprintf( fileName, sizeof( fileName ), "layouts/%s/%s.dat", map, s ); 
    38723784    if( trap_FS_FOpenFile( fileName, NULL, FS_READ ) > 0 ) 
     
    39033815} 
    39043816 
    3905 /* 
    3906 ============ 
    3907 G_LayoutBuildItem 
    3908 ============ 
    3909 */ 
    39103817static void G_LayoutBuildItem( buildable_t buildable, vec3_t origin, 
    39113818  vec3_t angles, vec3_t origin2, vec3_t angles2 ) 
    39123819{ 
    39133820  gentity_t *builder; 
    3914  
     3821   
    39153822  builder = G_Spawn( ); 
    39163823  builder->client = 0; 
     
    39463853  if( !level.layout[ 0 ] || !Q_stricmp( level.layout, "*BUILTIN*" ) ) 
    39473854    return; 
    3948  
     3855  
    39493856  trap_Cvar_VariableStringBuffer( "mapname", map, sizeof( map ) ); 
    39503857  len = trap_FS_FOpenFile( va( "layouts/%s/%s.dat", map, level.layout ), 
     
    39653872      G_Printf( S_COLOR_RED "ERROR: line overflow in %s before \"%s\"\n", 
    39663873       va( "layouts/%s/%s.dat", map, level.layout ), line ); 
    3967       return; 
     3874      return;  
    39683875    } 
    39693876    line[ i++ ] = *layout; 
     
    39713878    if( *layout == '\n' ) 
    39723879    { 
    3973       i = 0; 
     3880      i = 0;  
    39743881      sscanf( line, "%d %f %f %f %f %f %f %f %f %f %f %f %f\n", 
    39753882        &buildable, 
     
    39893896} 
    39903897 
    3991 /* 
    3992 ============ 
    3993 G_BaseSelfDestruct 
    3994 ============ 
    3995 */ 
    39963898void G_BaseSelfDestruct( pTeam_t team ) 
    39973899{ 
  • src/game/g_client.c

    r122 r2  
    777777  SpawnCorpse( ent ); 
    778778 
    779   // Clients can't respawn - they must go through the class cmd 
     779  //TA: Clients can't respawn - they must go thru the class cmd 
    780780  ent->client->pers.classSelection = PCL_NONE; 
    781781  ClientSpawn( ent, NULL, NULL, NULL ); 
     
    890890  if( *p == 0 || colorlessLen == 0 ) 
    891891    Q_strncpyz( p, "UnnamedPlayer", outSize ); 
    892 } 
    893  
    894  
    895 /* 
    896 =================== 
    897 G_NextNewbieName 
    898  
    899 Generate a unique, known-good name for an UnnamedPlayer 
    900 =================== 
    901 */ 
    902 char *G_NextNewbieName( gentity_t *ent ) 
    903 { 
    904   char newname[ MAX_NAME_LENGTH ]; 
    905   char namePrefix[ MAX_NAME_LENGTH - 4 ]; 
    906   char err[ MAX_STRING_CHARS ]; 
    907  
    908   if( g_newbieNamePrefix.string[ 0 ] ) 
    909     Q_strncpyz( namePrefix, g_newbieNamePrefix.string , sizeof( namePrefix ) ); 
    910   else 
    911     strcpy( namePrefix, "Newbie#" ); 
    912  
    913   while( level.numNewbies < 10000 ) 
    914   { 
    915     strcpy( newname, va( "%s%i", namePrefix, level.numNewbies ) ); 
    916     if ( G_admin_name_check( ent, newname, err, sizeof( err ) ) ) 
    917     { 
    918       return va( "%s", newname ); 
    919     } 
    920     level.numNewbies++; // Only increments if the last requested name was used. 
    921   } 
    922   return "UnnamedPlayer"; 
    923892} 
    924893 
     
    1002971  char      err[ MAX_STRING_CHARS ]; 
    1003972  qboolean  revertName = qfalse; 
    1004   qboolean  showRenameMsg = qtrue; 
    1005973  gclient_t *client; 
    1006974  char      c1[ MAX_INFO_STRING ]; 
     
    10391007  if( strcmp( oldname, newname ) ) 
    10401008  { 
    1041  
    1042      if( !strlen( oldname ) && client->pers.connected != CON_CONNECTED ) 
    1043        showRenameMsg = qfalse; 
    1044       // in case we need to revert and there's no oldname 
    1045      ClientCleanName( va( "%s", client->pers.netname ), oldname, sizeof( oldname ) ); 
    1046  
    1047      if( g_newbieNumbering.integer ) 
    1048      { 
    1049        if( !strcmp( newname, "UnnamedPlayer" ) ) 
    1050           Q_strncpyz( newname, G_NextNewbieName( ent ), sizeof( newname ) ); 
    1051        if( !strcmp( oldname, "UnnamedPlayer" ) ) 
    1052           Q_strncpyz( oldname, G_NextNewbieName( ent ), sizeof( oldname ) ); 
    1053      } 
     1009    // in case we need to revert and there's no oldname 
     1010    if( client->pers.connected != CON_CONNECTED ) 
     1011        Q_strncpyz( oldname, "UnnamedPlayer", sizeof( oldname ) ); 
    10541012 
    10551013    if( client->pers.muted ) 
     
    10931051      Q_strncpyz( client->pers.netname, newname, 
    10941052        sizeof( client->pers.netname ) ); 
    1095       Info_SetValueForKey( userinfo, "name", newname ); 
    1096       trap_SetUserinfo( clientNum, userinfo ); 
    10971053      if( client->pers.connected == CON_CONNECTED ) 
    10981054      { 
     
    11091065  } 
    11101066 
    1111   if( client->pers.connected >= CON_CONNECTING && showRenameMsg ) 
     1067  if( client->pers.connected == CON_CONNECTED ) 
    11121068  { 
    11131069    if( strcmp( oldname, client->pers.netname ) ) 
     
    13981354  // locate ent at a spawn point 
    13991355 
    1400   client->pers.classSelection = PCL_NONE; 
    14011356  ClientSpawn( ent, NULL, NULL, NULL ); 
    14021357 
     
    14061361  G_admin_namelog_update( client, qfalse ); 
    14071362 
    1408   // autoregister client if possible 
    1409   G_admin_autoregister( ent ); 
    1410  
    14111363  // request the clients PTR code 
    14121364  trap_SendServerCommand( ent - g_entities, "ptrcrequest" ); 
     
    14161368  // count current clients and rank for scoreboard 
    14171369  CalculateRanks( ); 
    1418 } 
    1419  
    1420 /* 
    1421 ================== 
    1422 ClientPingOverride 
    1423  
    1424 Called by server every time a client connects to check 
    1425 whether it is immune to ping restrictions. 
    1426 ================== 
    1427 */ 
    1428 int ClientPingOverride( void ) 
    1429 { 
    1430   char userinfo[ MAX_INFO_STRING ]; 
    1431   // create a temporary gentity 
    1432   gentity_t ent; 
    1433   gclient_t client; 
    1434   ent.client = &client; 
    1435  
    1436   // userinfo for the client is not yet availible so just use Argv(1) 
    1437   trap_Argv( 1, userinfo, sizeof( userinfo ) ); 
    1438   Q_strncpyz( client.pers.guid, Info_ValueForKey( userinfo, "cl_guid" ), sizeof( client.pers.guid ) ); 
    1439   if ( !client.pers.guid[0] ) 
    1440     return 0; 
    1441    
    1442   return G_admin_permission( &ent, ADMF_PINGOVERRIDE ); 
    14431370} 
    14441371 
     
    14771404  teamLocal = client->pers.teamSelection; 
    14781405 
    1479   // only start client if chosen a class and joined a team 
     1406  //TA: only start client if chosen a class and joined a team 
    14801407  if( client->pers.classSelection == PCL_NONE && teamLocal == PTE_NONE ) 
    14811408  { 
     
    15891516  ent->flags = 0; 
    15901517 
    1591   // calculate each client's acceleration 
     1518  //TA: calculate each client's acceleration 
    15921519  ent->evaluateAcceleration = qtrue; 
    15931520 
     
    16461573  client->ps.stats[ STAT_STAMINA ] = MAX_STAMINA; 
    16471574 
    1648   client->jetpack_beat = 0; 
    1649   client->jetpack_power = g_jetpackLimit.integer; 
    1650  
    16511575  G_SetOrigin( ent, spawn_origin ); 
    16521576  VectorCopy( spawn_origin, client->ps.origin ); 
     
    17571681  } 
    17581682 
    1759   // must do this here so the number of active clients is calculated 
     1683  //TA: must do this here so the number of active clients is calculated 
    17601684  CalculateRanks( ); 
    17611685 
     
    17931717  G_admin_namelog_update( ent->client, qtrue ); 
    17941718  G_LeaveTeam( ent ); 
    1795   G_Vote( ent, qfalse ); 
    17961719 
    17971720  // stop any following clients 
  • src/game/g_cmds.c

    r122 r1  
    5353      skip = qfalse; 
    5454    } 
    55  
     55     
    5656    if( *in == 27 || *in == '^' ) 
    5757    { 
     
    6868    *out++ = tolower( *in++ ); 
    6969  } 
    70   out -= spaces; 
     70  out -= spaces;  
    7171  *out = 0; 
    7272} 
     
    9797    cl = &level.clients[ idnum ]; 
    9898 
    99     if( cl->pers.connected == CON_DISCONNECTED ) 
     99    if( cl->pers.connected != CON_CONNECTED ) 
    100100      return -1; 
    101101 
     
    108108  for( idnum = 0, cl = level.clients; idnum < level.maxclients; idnum++, cl++ ) 
    109109  { 
    110     if( cl->pers.connected == CON_DISCONNECTED ) 
     110    if( cl->pers.connected != CON_CONNECTED ) 
    111111      continue; 
    112112 
     
    127127This is a companion function to G_ClientNumbersFromString() 
    128128 
    129 err will be populated with an error message. 
    130 ================== 
    131 */ 
    132 void G_MatchOnePlayer( int *plist, int num, char *err, int len ) 
     129returns qtrue if the int array plist only has one client id, false otherwise 
     130In the case of false, err will be populated with an error message. 
     131================== 
     132*/ 
     133qboolean G_MatchOnePlayer( int *plist, char *err, int len ) 
    133134{ 
    134135  gclient_t *cl; 
    135   int i; 
     136  int *p; 
    136137  char line[ MAX_NAME_LENGTH + 10 ] = {""}; 
    137138 
    138139  err[ 0 ] = '\0'; 
    139   if( num == 0 ) 
     140  if( plist[ 0 ] == -1 ) 
    140141  { 
    141142    Q_strcat( err, len, "no connected player by that name or slot #" ); 
    142   } 
    143   else if( num > 1 ) 
     143    return qfalse; 
     144  } 
     145  if( plist[ 1 ] != -1 ) 
    144146  { 
    145147    Q_strcat( err, len, "more than one player name matches. " 
    146148            "be more specific or use the slot #:\n" ); 
    147     for( i = 0; i < num; i++ ) 
    148     { 
    149       cl = &level.clients[ plist[ i ] ]; 
    150       if( cl->pers.connected == CON_DISCONNECTED ) 
    151         continue; 
    152       Com_sprintf( line, sizeof( line ), "%2i - %s^7\n", 
    153         plist[ i ], cl->pers.netname ); 
    154       if( strlen( err ) + strlen( line ) > len ) 
    155         break; 
    156       Q_strcat( err, len, line ); 
    157     } 
    158   } 
     149    for( p = plist; *p != -1; p++ ) 
     150    { 
     151      cl = &level.clients[ *p ]; 
     152      if( cl->pers.connected == CON_CONNECTED ) 
     153      { 
     154        Com_sprintf( line, sizeof( line ), "%2i - %s^7\n", 
     155          *p, cl->pers.netname ); 
     156        if( strlen( err ) + strlen( line ) > len ) 
     157          break; 
     158        Q_strcat( err, len, line ); 
     159      } 
     160    } 
     161    return qfalse; 
     162  } 
     163  return qtrue; 
    159164} 
    160165 
     
    164169 
    165170Sets plist to an array of integers that represent client numbers that have 
    166 names that are a partial match for s. 
    167  
    168 Returns number of matching clientids up to max. 
    169 ================== 
    170 */ 
    171 int G_ClientNumbersFromString( char *s, int *plist, int max ) 
     171names that are a partial match for s. List is terminated by a -1. 
     172 
     173Returns number of matching clientids. 
     174================== 
     175*/ 
     176int G_ClientNumbersFromString( char *s, int *plist ) 
    172177{ 
    173178  gclient_t *p; 
    174179  int i, found = 0; 
    175   char n2[ MAX_NAME_LENGTH ] = {""}; 
    176   char s2[ MAX_NAME_LENGTH ] = {""}; 
     180  char n2[ MAX_NAME_LENGTH ] = {""};  
     181  char s2[ MAX_NAME_LENGTH ] = {""};  
     182  qboolean is_slot = qtrue; 
     183 
     184  *plist = -1; 
    177185 
    178186  // if a number is provided, it might be a slot # 
    179   for( i = 0; s[ i ] && isdigit( s[ i ] ); i++ ); 
    180   if( !s[ i ] ) 
    181   { 
     187  for( i = 0; i < (int)strlen( s ); i++ ) 
     188  { 
     189    if( s[i] < '0' || s[i] > '9' ) 
     190    { 
     191      is_slot = qfalse; 
     192      break; 
     193    } 
     194  } 
     195 
     196  if( is_slot ) { 
    182197    i = atoi( s ); 
    183     if( i >= 0 && i < level.maxclients ) 
    184     { 
     198    if( i >= 0 && i < level.maxclients ) { 
    185199      p = &level.clients[ i ]; 
    186       if( p->pers.connected != CON_DISCONNECTED ) 
    187       { 
    188         *plist = i; 
     200      if( p->pers.connected == CON_CONNECTED || 
     201        p->pers.connected == CON_CONNECTING )  
     202      { 
     203        *plist++ = i; 
     204        *plist = -1; 
    189205        return 1; 
    190206      } 
     
    198214  if( strlen( s2 ) < 1 ) 
    199215    return 0; 
    200   for( i = 0; i < level.maxclients && found <= max; i++ ) 
     216  for( i = 0; i < level.maxclients; i++ ) 
    201217  { 
    202218    p = &level.clients[ i ]; 
    203     if( p->pers.connected == CON_DISCONNECTED ) 
     219    if(p->pers.connected != CON_CONNECTED 
     220      && p->pers.connected != CON_CONNECTING) 
    204221    { 
    205222      continue; 
     
    212229    } 
    213230  } 
     231  *plist = -1; 
    214232  return found; 
    215233} 
     
    527545    return; 
    528546 
    529   G_TeamVote( self, qfalse ); 
    530  
    531547  for( i = 0; i < level.num_entities; i++ ) 
    532548  { 
     
    620636  ent->client->pers.joinedATeam = qtrue; 
    621637  ent->client->pers.teamChangeTime = level.time; 
     638 
    622639  //update ClientInfo 
    623640  ClientUserinfoChanged( ent->client->ps.clientNum ); 
    624   CalculateRanks( ); 
    625641} 
    626642 
     
    638654  int     aliens = level.numAlienClients; 
    639655  int     humans = level.numHumanClients; 
    640   int     warmup; 
    641656 
    642657  // stop team join spam 
    643658  if( level.time - ent->client->pers.teamChangeTime < 1000 ) 
    644659    return; 
    645  
    646   // do warm up 
    647   if( g_doWarmup.integer ) 
    648   { 
    649     warmup = g_warmup.integer - ( ( level.time - level.startTime ) / 1000) - 1; 
    650     if( warmup > 0 ) 
    651     { 
    652       trap_SendServerCommand( ent - g_entities, va( "print \"team: you can't join" 
    653             " a team during warm up (%d seconds remaining)\n\"", warmup ) ); 
    654       return; 
    655     } 
    656   } 
    657660 
    658661  if( oldteam == PTE_ALIENS ) 
     
    661664    humans--; 
    662665 
     666  // do warm up 
     667  if( g_doWarmup.integer && 
     668      level.time - level.startTime < g_warmup.integer * 1000 ) 
     669  { 
     670    /* 
     671    trap_SendServerCommand( ent - g_entities, va( "print \"team: you can't join" 
     672      " a team during warm up (%d seconds remaining)\n\"", 
     673      g_warmup.integer - ( level.time - level.startTime ) / 1000 ) ); 
     674    */ 
     675    return; 
     676  } 
     677 
    663678  trap_Argv( 1, s, sizeof( s ) ); 
    664679 
     
    667682    trap_SendServerCommand( ent-g_entities, va("print \"team: %i\n\"", 
    668683      oldteam ) ); 
    669     return; 
    670   } 
    671  
    672   // g_maxGameClients stuff 
    673   if( !force && oldteam == PTE_NONE && g_maxGameClients.integer && 
    674            level.numPlayingClients >= g_maxGameClients.integer ) 
    675   { 
    676     trap_SendServerCommand( ent-g_entities, va( "print \"The maximum number of " 
    677       "playing clients has been reached (g_maxGameClients = %d)\n\"", 
    678       g_maxGameClients.integer ) ); 
    679     return; 
    680   } 
    681  
    682   //guard against build timer exploit 
    683   if( ent->client->pers.teamSelection != PTE_NONE && 
    684       ( ent->client->ps.stats[ STAT_PCLASS ] == PCL_ALIEN_BUILDER0 || 
    685       ent->client->ps.stats[ STAT_PCLASS ] == PCL_ALIEN_BUILDER0_UPG || 
    686       BG_InventoryContainsWeapon( WP_HBUILD, ent->client->ps.stats ) || 
    687       BG_InventoryContainsWeapon( WP_HBUILD2, ent->client->ps.stats ) ) && 
    688       ent->client->ps.stats[ STAT_MISC ] > 0 ) 
    689   { 
    690     trap_SendServerCommand( ent-g_entities, va( "print \"You cannot change teams until build timer expires\n\"" ) ); 
    691684    return; 
    692685  } 
     
    702695      return;  
    703696    } 
    704  
    705     if( !force && !level.humanTeamLocked && g_teamForceBalance.integer && aliens > humans ) 
    706     { 
     697    else if( level.humanTeamLocked ) 
     698    { 
     699      // if only one team has been locked, let people join the other 
     700      // regardless of balance 
     701      force = qtrue; 
     702    } 
     703 
     704    if( !force && g_teamForceBalance.integer && 
     705        ent->client->pers.teamSelection == PTE_ALIENS && 
     706        aliens > humans ) 
     707    { 
     708      //G_TriggerMenu( ent - g_entities, MN_A_TEAMFULL ); 
    707709      trap_SendServerCommand( ent-g_entities, va("print \"team: The alien team has too many players.\n\"" ) ); 
    708710      return; 
     
    719721      return;  
    720722    } 
    721     if( !force && !level.alienTeamLocked && g_teamForceBalance.integer && humans > aliens ) 
    722     { 
     723    else if( level.alienTeamLocked ) 
     724    { 
     725      // if only one team has been locked, let people join the other 
     726      // regardless of balance 
     727      force = qtrue; 
     728    } 
     729 
     730    if( !force && g_teamForceBalance.integer && 
     731        ent->client->pers.teamSelection == PTE_HUMANS && 
     732        humans > aliens ) 
     733    { 
     734      //G_TriggerMenu( ent - g_entities, MN_H_TEAMFULL ); 
    723735      trap_SendServerCommand( ent-g_entities, va("print \"team: The human team has too many players.\n\"" ) ); 
    724736      return; 
     
    731743    if( level.humanTeamLocked && level.alienTeamLocked ) 
    732744      team = PTE_NONE; 
    733     else if(humans > aliens ) 
     745    else if( level.numHumanClients > level.numAlienClients || 
     746        (ent->client->pers.teamSelection == PTE_ALIENS && 
     747        humans > aliens ) ) 
    734748      team = PTE_ALIENS; 
    735     else if( humans < aliens ) 
     749    else if( ( level.numHumanClients < level.numAlienClients ) || 
     750        ( ent->client->pers.teamSelection == PTE_HUMANS && 
     751          humans < aliens ) ) 
    736752      team = PTE_HUMANS; 
    737753    else 
     
    750766 
    751767  // stop team join spam 
    752   if( ent->client->pers.teamSelection == team ) 
    753     return; 
    754  
     768  if( oldteam == team ) 
     769    return; 
     770 
     771  //guard against build timer exploit 
     772  if( oldteam != PTE_NONE && 
     773     ( ent->client->ps.stats[ STAT_PCLASS ] == PCL_ALIEN_BUILDER0 || 
     774       ent->client->ps.stats[ STAT_PCLASS ] == PCL_ALIEN_BUILDER0_UPG || 
     775       BG_InventoryContainsWeapon( WP_HBUILD, ent->client->ps.stats ) || 
     776       BG_InventoryContainsWeapon( WP_HBUILD2, ent->client->ps.stats ) ) && 
     777      ent->client->ps.stats[ STAT_MISC ] > 0 ) 
     778  { 
     779    trap_SendServerCommand( ent-g_entities, 
     780        va( "print \"You cannot change teams until build timer expires\n\"" ) ); 
     781    return; 
     782  } 
     783 
     784 
     785  oldteam = ent->client->pers.teamSelection; 
    755786  G_ChangeTeam( ent, team ); 
    756787 
    757   if( team == PTE_ALIENS ) 
    758   { 
     788  if( team == PTE_ALIENS ) { 
    759789    if ( oldteam == PTE_HUMANS ) 
    760       trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " abandoned humans and joined the aliens\n\"", ent->client->pers.netname ) ); 
     790      trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " abandoned humans and joined the aliens\n\"", 
     791                                      ent->client->pers.netname ) ); 
    761792    else 
    762       trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " joined the aliens\n\"", ent->client->pers.netname ) ); 
    763   } 
    764   else if( team == PTE_HUMANS ) 
    765   { 
     793      trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " joined the aliens\n\"", 
     794                                      ent->client->pers.netname ) ); 
     795  } 
     796  else if( team == PTE_HUMANS ) { 
    766797    if ( oldteam == PTE_ALIENS ) 
    767       trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " abandoned aliens and joined the humans\n\"", ent->client->pers.netname ) ); 
     798      trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " abandoned aliens and joined the humans\n\"", 
     799                                      ent->client->pers.netname ) ); 
    768800    else 
    769       trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " joined the humans\n\"", ent->client->pers.netname ) ); 
    770   } 
    771   else if( team == PTE_NONE ) 
    772   { 
     801      trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " joined the humans\n\"", 
     802                                      ent->client->pers.netname ) ); 
     803  } 
     804  else if( team == PTE_NONE ) { 
    773805    if ( oldteam == PTE_HUMANS ) 
    774       trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " left the humans\n\"", ent->client->pers.netname ) ); 
     806      trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " left the humans\n\"", 
     807                                      ent->client->pers.netname ) ); 
    775808    else 
    776       trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " left the aliens\n\"", ent->client->pers.netname ) ); 
     809      trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " left the aliens\n\"", 
     810                                      ent->client->pers.netname ) ); 
    777811  } 
    778812} 
     
    802836    return; 
    803837 
    804   if( ( mode == SAY_TEAM || mode == SAY_ACTION_T ) && !OnSameTeam( ent, other ) ) 
     838  if( mode == SAY_TEAM && !OnSameTeam( ent, other ) ) 
    805839  { 
    806840    toSend = qfalse; 
     
    821855  } 
    822856 
    823   if( mode == SAY_ADMINS && !G_admin_permission( other, ADMF_ADMINCHAT) ) 
    824          return; 
    825  
    826857  if( mode == SAY_ALL ) 
    827858    usePrefix = qtrue; 
     
    833864  { 
    834865    trap_SendServerCommand( other-g_entities, va( "%s \"%s%s%s%c%c%s\"", 
    835       ( mode == SAY_TEAM || mode == SAY_ACTION_T ) ? "tchat" : "chat", 
     866      mode == SAY_TEAM ? "tchat" : "chat", 
    836867      ( ignore ) ? "[skipnotify]" : "", 
    837868      usePrefix ? prefix : "", 
     
    887918      color = COLOR_GREEN; 
    888919      break; 
    889  
    890      case SAY_ACTION: 
    891        G_LogPrintf( "action: %s: %s\n", ent->client->pers.netname, chatText ); 
    892        Com_sprintf( name, sizeof( name ), "^2%s^7%s%s%c%c"EC" ", g_actionPrefix.string, prefix, 
    893              ent->client->pers.netname, Q_COLOR_ESCAPE, COLOR_WHITE ); 
    894        color = COLOR_WHITE; 
    895        break; 
    896      case SAY_ACTION_T: 
    897        G_LogPrintf( "actionteam: %s: %s\n", ent->client->pers.netname, chatText ); 
    898        if( Team_GetLocationMsg( ent, location, sizeof( location ) ) ) 
    899        Com_sprintf( name, sizeof( name ), EC"^5%s^7%s%c%c"EC"(%s)"EC" ", g_actionPrefix.string,  
    900              ent->client->pers.netname, Q_COLOR_ESCAPE, COLOR_WHITE, location ); 
    901        else 
    902          Com_sprintf( name, sizeof( name ), EC"^5%s^7%s%c%c"EC""EC" ", g_actionPrefix.string,  
    903          ent->client->pers.netname, Q_COLOR_ESCAPE, COLOR_WHITE ); 
    904          color = COLOR_WHITE; 
    905        break; 
    906920 
    907921    case SAY_TEAM: 
     
    931945      color = COLOR_MAGENTA; 
    932946      break; 
    933        
    934     case SAY_ADMINS: 
    935       if( G_admin_permission( ent, ADMF_ADMINCHAT ) ) //Differentiate between inter-admin chatter and user-admin alerts 
    936       { 
    937         G_LogPrintf( "say_admins: [ADMIN]%s: %s\n", ent->client->pers.netname, chatText ); 
    938         Com_sprintf( name, sizeof( name ), "%s[ADMIN]%s%c%c"EC": ", prefix, 
    939                                ent->client->pers.netname, Q_COLOR_ESCAPE, COLOR_WHITE ); 
    940         color = COLOR_MAGENTA; 
    941        } 
    942        else 
    943        { 
    944          G_LogPrintf( "say_admins: [PLAYER]%s: %s\n", ent->client->pers.netname, chatText ); 
    945          Com_sprintf( name, sizeof( name ), "%s[PLAYER]%s%c%c"EC": ", prefix, 
    946                              ent->client->pers.netname, Q_COLOR_ESCAPE, COLOR_WHITE ); 
    947          color = COLOR_MAGENTA; 
    948         } 
    949        break; 
    950   } 
    951  
    952   Com_sprintf( text, sizeof( text ), "%s^7", chatText ); 
     947  } 
     948 
     949  Q_strncpyz( text, chatText, sizeof( text ) ); 
    953950 
    954951  //R1's simple flood protection (lowered in g_client timer actions) 
     
    989986  char    *p; 
    990987  char    *args; 
    991   int     offset = 0; 
    992988  int     mode = SAY_ALL; 
    993989 
     
    995991  if( Q_stricmpn( args, "say_team ", 9 ) == 0 ) 
    996992    mode = SAY_TEAM; 
    997   if( Q_stricmpn( args, "say_admins ", 11 ) == 0 || Q_stricmpn( args, "a ", 2 ) == 0) 
    998     mode = SAY_ADMINS; 
    999993 
    1000994  // support parsing /m out of say text since some people have a hard 
     
    10081002    return; 
    10091003  } 
    1010    
    1011   if( !Q_stricmpn( args, "say /a ", 7) || 
    1012       !Q_stricmpn( args, "say_team /a ", 12) || 
    1013       !Q_stricmpn( args, "say /say_admins ", 16) || 
    1014       !Q_stricmpn( args, "say_team /say_admins ", 21) ) 
    1015   { 
    1016       mode = SAY_ADMINS; 
    1017       offset =3; 
    1018   } 
    1019    
    1020   if( mode == SAY_ADMINS)   
    1021   if(!G_admin_permission( ent, ADMF_ADMINCHAT ) ) 
    1022   { 
    1023     if( !g_publicSayadmins.integer ) 
    1024     { 
    1025      ADMP( "Sorry, but public use of say_admins has been disabled.\n" ); 
    1026      return; 
    1027     } 
    1028     else 
    1029     { 
    1030       ADMP( "Your message has been sent to any available admins and to the server logs.\n" ); 
    1031     } 
    1032   } 
    1033    
     1004 
    10341005  if( g_allowDonate.integer ) 
    10351006  { 
     
    10561027    } 
    10571028  } 
    1058    
    1059   if( g_allowActions.integer && !Q_stricmpn( args, "say /me ", 8 ) ) 
    1060   { 
    1061     mode = SAY_ACTION; 
    1062     offset = 4; 
    1063   } 
    1064  
    1065   if( g_allowActions.integer && !Q_stricmpn( args, "say_team /me ", 13 ) ) 
    1066   { 
    1067     mode = SAY_ACTION_T; 
    1068     offset = 4; 
    1069   } 
    10701029 
    10711030  p = ConcatArgs( 1 ); 
    1072   p += offset; 
    10731031 
    10741032  G_Say( ent, NULL, mode, p ); 
     
    11861144    } 
    11871145 
    1188     if( G_ClientNumbersFromString( arg2, clientNums, MAX_CLIENTS ) == 1 ) 
     1146    if( G_ClientNumbersFromString( arg2, clientNums ) == 1 ) 
    11891147    { 
    11901148      // there was only one partial name match 
     
    11981156 
    11991157    if( clientNum != -1 && 
    1200       level.clients[ clientNum ].pers.connected != CON_CONNECTED ) 
     1158      level.clients[ clientNum ].pers.connected == CON_DISCONNECTED ) 
    12011159    { 
    12021160      clientNum = -1; 
     
    12661224      "Un-Mute player \'%s\'", name ); 
    12671225  } 
    1268   else if( !Q_stricmp( arg1, "restartmap" ) ) 
     1226  else if( !Q_stricmp( arg1, "map_restart" ) ) 
    12691227  { 
    12701228    Com_sprintf( level.voteString, sizeof( level.voteString ), "%s", arg1 ); 
     
    12851243        sizeof( level.voteDisplayString ), "Change to map '%s'", arg2 ); 
    12861244  } 
    1287   else if( !Q_stricmp( arg1, "nextmap" ) ) 
    1288   { 
    1289     Com_sprintf( level.voteString, sizeof( level.voteString ), "advanceMapRotation" ); 
     1245  else if( !Q_stricmp( arg1, "draw" ) ) 
     1246  { 
     1247    Com_sprintf( level.voteString, sizeof( level.voteString ), "evacuation" ); 
    12901248    Com_sprintf( level.voteDisplayString, sizeof( level.voteDisplayString ), 
    1291         "Skip to next map in rotation" ); 
     1249        "End match in a draw" ); 
    12921250  } 
    12931251  else 
     
    12951253    trap_SendServerCommand( ent-g_entities, "print \"Invalid vote string\n\"" ); 
    12961254    trap_SendServerCommand( ent-g_entities, "print \"Valid vote commands are: " 
    1297       "map, restartmap, nextmap, kick, mute and unmute\n" ); 
     1255      "map, map_restart, draw, kick, mute and unmute\n" ); 
    12981256    return; 
    12991257  } 
     
    13101268  level.voteYes = 1; 
    13111269  level.voteNo = 0; 
    1312   ent->client->pers.vote = qtrue; 
    13131270 
    13141271  for( i = 0 ; i < level.maxclients ; i++ ) 
     
    13191276  trap_SetConfigstring( CS_VOTE_TIME, va( "%i", level.voteTime ) ); 
    13201277  trap_SetConfigstring( CS_VOTE_STRING, level.voteDisplayString ); 
    1321   trap_SetConfigstring( CS_VOTE_YES, "1" ); 
    1322   trap_SetConfigstring( CS_VOTE_NO, "0" ); 
     1278  trap_SetConfigstring( CS_VOTE_YES, va( "%i", level.voteYes ) ); 
     1279  trap_SetConfigstring( CS_VOTE_NO, va( "%i", level.voteNo ) ); 
    13231280} 
    13241281 
     
    13461303  trap_SendServerCommand( ent-g_entities, "print \"Vote cast\n\"" ); 
    13471304 
     1305  ent->client->ps.eFlags |= EF_VOTED; 
     1306 
    13481307  trap_Argv( 1, msg, sizeof( msg ) ); 
    1349   ent->client->pers.vote = ( tolower( msg[ 0 ] ) == 'y' || msg[ 0 ] == '1' ); 
    1350   G_Vote( ent, qtrue ); 
    1351  
    1352   // a majority will be determined in CheckVote, which will also account 
     1308 
     1309  if( msg[ 0 ] == 'y' || msg[ 1 ] == 'Y' || msg[ 1 ] == '1' ) 
     1310  { 
     1311    level.voteYes++; 
     1312    trap_SetConfigstring( CS_VOTE_YES, va( "%i", level.voteYes ) ); 
     1313  } 
     1314  else 
     1315  { 
     1316    level.voteNo++; 
     1317    trap_SetConfigstring( CS_VOTE_NO, va( "%i", level.voteNo ) ); 
     1318  } 
     1319 
     1320  // a majority will be determined in G_CheckVote, which will also account 
    13531321  // for players entering or leaving 
    13541322} 
     
    14181386    } 
    14191387 
    1420     if( G_ClientNumbersFromString( arg2, clientNums, MAX_CLIENTS ) == 1 ) 
     1388    if( G_ClientNumbersFromString( arg2, clientNums ) == 1 ) 
    14211389    { 
    14221390      // there was only one partial name match 
     
    15301498  ent->client->pers.voteCount++; 
    15311499 
    1532   G_TeamCommand( team, va( "print \"%s " S_COLOR_WHITE "called a team vote\n\"", 
    1533     ent->client->pers.netname ) ); 
     1500  for( i = 0 ; i < level.maxclients ; i++ ) 
     1501  { 
     1502    if( level.clients[ i ].pers.connected == CON_DISCONNECTED ) 
     1503      continue; 
     1504 
     1505    if( level.clients[ i ].ps.stats[ STAT_PTEAM ] == team ) 
     1506      trap_SendServerCommand( i, va("print \"%s " S_COLOR_WHITE 
     1507            "called a team vote\n\"", ent->client->pers.netname ) ); 
     1508  } 
     1509  G_Printf( "'%s^7' called a teamvote for '%s'\n", ent->client->pers.netname,  
     1510    level.teamVoteString[ cs_offset ] ) ; 
    15341511 
    15351512  // start the voting, the caller autoamtically votes yes 
     
    15371514  level.teamVoteYes[ cs_offset ] = 1; 
    15381515  level.teamVoteNo[ cs_offset ] = 0; 
    1539   ent->client->pers.teamVote = qtrue; 
    15401516 
    15411517  for( i = 0 ; i < level.maxclients ; i++ ) 
     
    15471523  ent->client->ps.eFlags |= EF_TEAMVOTED; 
    15481524 
    1549   trap_SetConfigstring( CS_TEAMVOTE_TIME + cs_offset, 
    1550     va( "%i", level.teamVoteTime[ cs_offset ] ) ); 
    1551   trap_SetConfigstring( CS_TEAMVOTE_STRING + cs_offset, 
    1552     level.teamVoteDisplayString[ cs_offset ] ); 
    1553   trap_SetConfigstring( CS_TEAMVOTE_YES + cs_offset, "1" ); 
    1554   trap_SetConfigstring( CS_TEAMVOTE_NO + cs_offset, "0" ); 
     1525  trap_SetConfigstring( CS_TEAMVOTE_TIME + cs_offset, va( "%i", level.teamVoteTime[ cs_offset ] ) ); 
     1526  trap_SetConfigstring( CS_TEAMVOTE_STRING + cs_offset, level.teamVoteDisplayString[ cs_offset ] ); 
     1527  trap_SetConfigstring( CS_TEAMVOTE_YES + cs_offset, va( "%i", level.teamVoteYes[ cs_offset ] ) ); 
     1528  trap_SetConfigstring( CS_TEAMVOTE_NO + cs_offset, va( "%i", level.teamVoteNo[ cs_offset ] ) ); 
    15551529} 
    15561530 
     
    15831557  trap_SendServerCommand( ent-g_entities, "print \"Team vote cast\n\"" ); 
    15841558 
     1559  ent->client->ps.eFlags |= EF_TEAMVOTED; 
     1560 
    15851561  trap_Argv( 1, msg, sizeof( msg ) ); 
    1586   ent->client->pers.teamVote = ( tolower( msg[ 0 ] ) == 'y' || msg[ 0 ] == '1' ); 
    1587   G_TeamVote( ent, qtrue ); 
    1588  
    1589   // a majority will be determined in CheckTeamVote, which will also account 
     1562 
     1563  if( msg[ 0 ] == 'y' || msg[ 1 ] == 'Y' || msg[ 1 ] == '1' ) 
     1564  { 
     1565    level.teamVoteYes[ cs_offset ]++; 
     1566    trap_SetConfigstring( CS_TEAMVOTE_YES + cs_offset, va( "%i", level.teamVoteYes[ cs_offset ] ) ); 
     1567  } 
     1568  else 
     1569  { 
     1570    level.teamVoteNo[ cs_offset ]++; 
     1571    trap_SetConfigstring( CS_TEAMVOTE_NO + cs_offset, va( "%i", level.teamVoteNo[ cs_offset ] ) ); 
     1572  } 
     1573 
     1574  // a majority will be determined in TeamCheckVote, which will also account 
    15901575  // for players entering or leaving 
    15911576} 
     
    16251610#define EVOLVE_TRACE_HEIGHT 128.0f 
    16261611#define AS_OVER_RT3         ((ALIENSENSE_RANGE*0.5f)/M_ROOT3) 
    1627  
    1628 static qboolean G_RoomForClassChange( gentity_t *ent, pClass_t class, 
    1629   vec3_t newOrigin ) 
    1630 { 
    1631   vec3_t    fromMins, fromMaxs; 
    1632   vec3_t    toMins, toMaxs; 
    1633   vec3_t    temp; 
    1634   trace_t   tr; 
    1635   float     nudgeHeight; 
    1636   float     maxHorizGrowth; 
    1637   pClass_t  oldClass = ent->client->ps.stats[ STAT_PCLASS ]; 
    1638  
    1639   BG_FindBBoxForClass( oldClass, fromMins, fromMaxs, NULL, NULL, NULL ); 
    1640   BG_FindBBoxForClass( class, toMins, toMaxs, NULL, NULL, NULL ); 
    1641  
    1642   VectorCopy( ent->s.origin, newOrigin ); 
    1643  
    1644   // find max x/y diff 
    1645   maxHorizGrowth = toMaxs[ 0 ] - fromMaxs[ 0 ]; 
    1646   if( toMaxs[ 1 ] - fromMaxs[ 1 ] > maxHorizGrowth ) 
    1647     maxHorizGrowth = toMaxs[ 1 ] - fromMaxs[ 1 ]; 
    1648   if( toMins[ 0 ] - fromMins[ 0 ] > -maxHorizGrowth ) 
    1649     maxHorizGrowth = -( toMins[ 0 ] - fromMins[ 0 ] ); 
    1650   if( toMins[ 1 ] - fromMins[ 1 ] > -maxHorizGrowth ) 
    1651     maxHorizGrowth = -( toMins[ 1 ] - fromMins[ 1 ] ); 
    1652  
    1653   if( maxHorizGrowth > 0.0f ) 
    1654   { 
    1655     // test by moving the player up the max required on a 60 degree slope 
    1656     nudgeHeight = maxHorizGrowth * 2.0f; 
    1657   } 
    1658   else 
    1659   { 
    1660     // player is shrinking, so there's no need to nudge them upwards 
    1661     nudgeHeight = 0.0f; 
    1662   } 
    1663  
    1664   // find what the new origin would be on a level surface 
    1665   newOrigin[ 2 ] += fabs( toMins[ 2 ] ) - fabs( fromMins[ 2 ] ); 
    1666  
    1667   //compute a place up in the air to start the real trace 
    1668   VectorCopy( newOrigin, temp ); 
    1669   temp[ 2 ] += nudgeHeight; 
    1670   trap_Trace( &tr, newOrigin, toMins, toMaxs, temp, ent->s.number, MASK_SHOT ); 
    1671  
    1672   //trace down to the ground so that we can evolve on slopes 
    1673   VectorCopy( newOrigin, temp ); 
    1674   temp[ 2 ] += ( nudgeHeight * tr.fraction ); 
    1675   trap_Trace( &tr, temp, toMins, toMaxs, newOrigin, ent->s.number, MASK_SHOT ); 
    1676   VectorCopy( tr.endpos, newOrigin ); 
    1677  
    1678   //make REALLY sure 
    1679   trap_Trace( &tr, newOrigin, toMins, toMaxs, newOrigin, 
    1680     ent->s.number, MASK_SHOT ); 
    1681  
    1682   //check there is room to evolve 
    1683   if( !tr.startsolid && tr.fraction == 1.0f ) 
    1684     return qtrue; 
    1685   else 
    1686     return qfalse; 
    1687 } 
    16881612 
    16891613/* 
     
    20241948          G_TeamCommand( ent->client->pers.teamSelection, 
    20251949            va( "print \"%s ^3DECONSTRUCTED^7 by %s^7\n\"", 
    2026               BG_FindHumanNameForBuildable( traceEnt->s.modelindex ), 
     1950              BG_FindHumanNameForBuildable( traceEnt->s.modelindex ),  
    20271951              ent->client->pers.netname ) ); 
    20281952 
     
    20301954            ent->client->ps.clientNum, 
    20311955            traceEnt->s.modelindex, 
    2032             ent->client->pers.netname, 
     1956            ent->client->pers.netname,  
    20331957            BG_FindNameForBuildable( traceEnt->s.modelindex ) ); 
    20341958 
     
    21332057    //special case to allow switching between 
    21342058    //the blaster and the primary weapon 
    2135     ent->client->ps.weaponTime = 0; 
    21362059 
    21372060    if( ent->client->ps.weapon != WP_BLASTER ) 
     
    23442267    else 
    23452268    { 
    2346       if( upgrade == UP_BATTLESUIT ) 
    2347       { 
    2348         vec3_t newOrigin; 
    2349  
    2350         if( !G_RoomForClassChange( ent, PCL_HUMAN_BSUIT, newOrigin ) ) 
    2351         { 
    2352           trap_SendServerCommand( ent-g_entities, va( "print \"Not enough room here to put on a Battle Suit\n\"") ); 
    2353           return; 
    2354         } 
    2355         VectorCopy( newOrigin, ent->s.pos.trBase ); 
    2356         ent->client->ps.stats[ STAT_PCLASS ] = PCL_HUMAN_BSUIT; 
    2357         ent->client->ps.eFlags ^= EF_TELEPORT_BIT; 
    2358       } 
    2359  
    23602269      //add to inventory 
    23612270      BG_AddUpgradeToInventory( upgrade, ent->client->ps.stats ); 
     
    24532362    if( BG_InventoryContainsUpgrade( upgrade, ent->client->ps.stats ) ) 
    24542363    { 
    2455       // shouldn't really need to test for this, but just to be safe 
    2456       if( upgrade == UP_BATTLESUIT ) 
    2457       { 
    2458         vec3_t newOrigin; 
    2459  
    2460         if( !G_RoomForClassChange( ent, PCL_HUMAN, newOrigin ) ) 
    2461         { 
    2462           trap_SendServerCommand( ent-g_entities, va( "print \"Not enough room here to take off your  Battle Suit\n\"") ); 
    2463           return; 
    2464         } 
    2465         VectorCopy( newOrigin, ent->s.pos.trBase ); 
    2466         ent->client->ps.stats[ STAT_PCLASS ] = PCL_HUMAN; 
    2467         ent->client->ps.eFlags ^= EF_TELEPORT_BIT; 
    2468       } 
    2469  
    2470       //add to inventory 
    24712364      BG_RemoveUpgradeFromInventory( upgrade, ent->client->ps.stats ); 
    24722365 
     
    25962489 
    25972490  if(g_repeaterOnReactor.integer && buildable == BA_H_REACTOR && level.reactorPresent) 
    2598     buildable = BA_H_REPEATER; 
     2491          buildable = BA_H_REPEATER; 
    25992492 
    26002493  team = ent->client->ps.stats[ STAT_PTEAM ]; 
     
    27182611      clientNum = atoi( arg1 ); 
    27192612    } 
    2720     else if( G_ClientNumbersFromString( arg1, clientNums, MAX_CLIENTS ) == 1 ) 
     2613    else if( G_ClientNumbersFromString( arg1, clientNums ) == 1 ) 
    27212614    { 
    27222615      // there was one partial name match 
     
    30762969  { 
    30772970    trap_Argv( 1, arg, sizeof( arg ) ); 
    3078     if( G_ClientNumbersFromString( arg, pids, MAX_CLIENTS ) == 1 ) 
     2971    if( G_ClientNumbersFromString( arg, pids ) == 1 ) 
    30792972    { 
    30802973      i = pids[ 0 ]; 
     
    32413134 
    32423135  Q_strncpyz( name, ConcatArgs( 1 ), sizeof( name ) ); 
    3243   matches = G_ClientNumbersFromString( name, pids, MAX_CLIENTS );  
     3136  matches = G_ClientNumbersFromString( name, pids );  
    32443137  if( matches < 1 ) 
    32453138  { 
     
    33023195  { "say", CMD_MESSAGE|CMD_INTERMISSION, Cmd_Say_f }, 
    33033196  { "say_team", CMD_MESSAGE|CMD_INTERMISSION, Cmd_Say_f }, 
    3304   { "say_admins", CMD_MESSAGE|CMD_INTERMISSION, Cmd_Say_f }, 
    3305   { "a", CMD_MESSAGE|CMD_INTERMISSION, Cmd_Say_f }, 
    33063197  { "m", CMD_MESSAGE|CMD_INTERMISSION, G_PrivateMessage }, 
    33073198  { "mt", CMD_MESSAGE|CMD_INTERMISSION, G_PrivateMessage }, 
    3308   { "me", CMD_MESSAGE|CMD_INTERMISSION, Cmd_Say_f }, 
     3199 
    33093200  { "score", CMD_INTERMISSION, ScoreboardMessage }, 
    33103201 
     
    35953486  G_SayArgv( 1+skipargs, name, sizeof( name ) ); 
    35963487  msg = G_SayConcatArgs( 2+skipargs ); 
    3597   pcount = G_ClientNumbersFromString( name, pids, MAX_CLIENTS ); 
     3488  pcount = G_ClientNumbersFromString( name, pids ); 
    35983489 
    35993490  if( ent ) 
  • src/game/g_combat.c

    r122 r1  
    186186    self->client->pers.netname, obit ); 
    187187 
    188   // close any menus the client has open 
     188  //TA: close any menus the client has open 
    189189  G_CloseMenus( self->client->ps.clientNum ); 
    190190 
    191   // deactivate all upgrades 
     191  //TA: deactivate all upgrades 
    192192  for( i = UP_NONE + 1; i < UP_NUM_UPGRADES; i++ ) 
    193193    BG_DeactivateUpgrade( i, self->client->ps.stats ); 
     
    379379  } 
    380380 
    381   self->client->pers.classSelection = PCL_NONE; // reset the classtype 
     381  self->client->pers.classSelection = PCL_NONE; //TA: reset the classtype 
    382382  VectorCopy( self->s.origin, self->client->pers.lastDeathLocation ); 
    383383 
     
    402402  self->client->respawnTime = level.time + 1700; 
    403403 
    404   // clear misc 
     404  // remove powerups 
    405405  memset( self->client->ps.powerups, 0, sizeof( self->client->ps.powerups ) ); 
    406406 
     
    461461  trap_LinkEntity( self ); 
    462462} 
     463 
     464 
     465////////TA: locdamage 
    463466 
    464467/* 
     
    709712  clientHeight = targ->r.maxs[ 2 ] - targ->r.mins[ 2 ]; 
    710713 
    711   BG_GetClientNormal( &targ->client->ps, normal ); 
     714  if( targ->client->ps.stats[ STAT_STATE ] & SS_WALLCLIMBING ) 
     715    VectorCopy( targ->client->ps.grapplePoint, normal ); 
     716  else 
     717    VectorSet( normal, 0, 0, 1 ); 
    712718 
    713719  VectorMA( targOrigin, targ->r.mins[ 2 ], normal, floor ); 
     
    885891} 
    886892 
     893////////TA: locdamage 
     894 
    887895 
    888896/* 
     
    910918*/ 
    911919 
    912 // team is the team that is immune to this damage 
     920//TA: team is the team that is immune to this damage 
    913921void G_SelectiveDamage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, 
    914922         vec3_t dir, vec3_t point, int damage, int dflags, int mod, int team ) 
     
    10401048        push[2] = 64.0f; 
    10411049        VectorAdd( targ->client->ps.velocity, push, targ->client->ps.velocity ); 
    1042         return; 
    1043       } 
    1044       else if( !g_friendlyFireMovementAttacks.integer && (mod == MOD_LEVEL4_CHARGE || mod == MOD_LEVEL3_POUNCE )){ 
    1045       // don't do friendly fire on movement attacks 
    10461050        return; 
    10471051      } 
     
    10671071                        if( !g_friendlyBuildableFire.integer ) 
    10681072                                return; 
    1069       // don't do friendly fire on movement attacks 
    1070       if( !g_friendlyFireMovementAttacks.integer && (mod == MOD_LEVEL4_CHARGE || mod == MOD_LEVEL3_POUNCE )) 
    1071         return; 
    10721073                } 
    10731074 
     
    11561157    targ->lastDamageTime = level.time; 
    11571158 
    1158     // add to the attackers "account" on the target 
     1159    //TA: add to the attackers "account" on the target 
    11591160    if( targ->client && attacker->client ) 
    11601161    { 
     
    12381239} 
    12391240 
     1241 
     1242//TA: 
    12401243/* 
    12411244============ 
  • src/game/g_local.h

    r122 r1  
    350350  int                 savedCredit; 
    351351 
    352   // votes 
    353   qboolean            vote; 
    354   qboolean            teamVote; 
    355  
    356352  vec3_t              lastDeathLocation; 
    357353  char                guid[ 33 ]; 
     
    412408 
    413409  // timers 
    414   int                 respawnTime;      // can respawn when time > this 
     410  int                 respawnTime;      // can respawn when time > this, force after g_forcerespwan 
    415411  int                 inactivityTime;   // kick players when time > this 
    416412  qboolean            inactivityWarning;// qtrue if the five seoond warning has been given 
     
    437433 
    438434  gentity_t           *hovel; 
     435 
     436  int                 lastUpdateFrame; 
     437  qboolean            warping; 
     438  qboolean            warped; 
    439439 
    440440  int                 lastPoisonTime; 
     
    468468  int                 unlaggedTime; 
    469469 
    470   int                 jetpack_beat;         // waiting time before turn on jetpack when power down 
    471   int                 jetpack_power; 
    472470}; 
    473471 
     
    565563  int               numPlayingClients;            // connected, non-spectators 
    566564  int               sortedClients[MAX_CLIENTS];   // sorted by score 
    567   int               numNewbies;                   // number of UnnamedPlayers who have been renamed this round. 
    568565 
    569566  int               snd_fry;                      // sound index for standing in lava 
     
    704701qboolean  G_FollowNewClient( gentity_t *ent, int dir ); 
    705702void      G_ToggleFollow( gentity_t *ent ); 
    706 void      G_MatchOnePlayer( int *plist, int num, char *err, int len ); 
    707 int       G_ClientNumbersFromString( char *s, int *plist, int max ); 
    708 void      G_Say( gentity_t *ent, gentity_t *target, int mode, const char *chatText ); 
     703qboolean  G_MatchOnePlayer( int *plist, char *err, int len ); 
     704int       G_ClientNumbersFromString( char *s, int *plist ); 
    709705int       G_SayArgc( void ); 
    710706qboolean  G_SayArgv( int n, char *buffer, int bufferLength ); 
     
    761757 
    762758gentity_t*        G_FindGenerator( buildableTeam_t team, vec3_t origin ); 
    763 buildable_t       G_IsPowered( vec3_t origin ); 
     759qboolean          G_IsPowered( vec3_t origin ); 
    764760qboolean          G_IsDCCBuilt( void ); 
    765761qboolean          G_IsOvermindBuilt( void ); 
     
    930926void      player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod ); 
    931927qboolean  SpotWouldTelefrag( gentity_t *spot ); 
    932 char     *G_NextNewbieName( gentity_t *ent ); 
    933928 
    934929// 
     
    964959void QDECL G_Printf( const char *fmt, ... ); 
    965960void QDECL G_Error( const char *fmt, ... ); 
    966 void G_Vote( gentity_t *ent, qboolean voting ); 
    967 void G_TeamVote( gentity_t *ent, qboolean voting ); 
    968961void CheckVote( void ); 
    969962void CheckTeamVote( int teamnum ); 
     
    980973void ClientBegin( int clientNum ); 
    981974void ClientCommand( int clientNum ); 
    982 int ClientPingOverride( void ); 
    983975 
    984976// 
     
    11191111extern  vmCvar_t  g_dedicated; 
    11201112extern  vmCvar_t  g_cheats; 
    1121 extern  vmCvar_t  g_version; 
    11221113extern  vmCvar_t  g_maxclients;     // allow this many total, including spectators 
    11231114extern  vmCvar_t  g_maxGameClients;   // allow this many active 
     
    11261117extern  vmCvar_t  g_minNameChangePeriod; 
    11271118extern  vmCvar_t  g_maxNameChanges; 
    1128 extern  vmCvar_t  g_newbieNumbering; 
    1129 extern  vmCvar_t  g_newbieNamePrefix; 
    11301119 
    11311120extern  vmCvar_t  g_timelimit; 
     
    11361125extern  vmCvar_t  g_friendlyFireAliens; 
    11371126extern  vmCvar_t  g_friendlyBuildableFire; 
    1138 extern  vmCvar_t  g_friendlyFireMovementAttacks; 
    11391127extern  vmCvar_t  g_password; 
    11401128extern  vmCvar_t  g_needpass; 
     
    11431131extern  vmCvar_t  g_knockback; 
    11441132extern  vmCvar_t  g_quadfactor; 
     1133extern  vmCvar_t  g_forcerespawn; 
    11451134extern  vmCvar_t  g_inactivity; 
    11461135extern  vmCvar_t  g_debugMove; 
     
    11691158extern  vmCvar_t  g_grangerMode; 
    11701159extern  vmCvar_t  g_repeaterOnReactor; 
    1171 extern  vmCvar_t  g_jetpackLimit; 
    11721160extern  vmCvar_t  g_autoDonate; 
    11731161extern  vmCvar_t  g_enableDust; 
     
    12101198extern  vmCvar_t  g_shove; 
    12111199 
     1200extern  vmCvar_t  g_maxWarp; 
     1201extern  vmCvar_t  g_skipCorrection; 
     1202 
    12121203extern  vmCvar_t  g_mapConfigs; 
    12131204 
     
    12211212extern  vmCvar_t  g_adminTempBan; 
    12221213extern  vmCvar_t  g_minLevelToSpecMM1; 
    1223 extern  vmCvar_t  g_adminWarnMessage; 
     1214 
    12241215extern  vmCvar_t  g_privateMessages; 
    1225 extern  vmCvar_t  g_publicSayadmins; 
    1226 extern  vmCvar_t  g_allowActions; 
    1227 extern  vmCvar_t  g_actionPrefix; 
    12281216extern  vmCvar_t  g_floodProtection; 
    1229 extern  vmCvar_t  g_autoRegister; 
    12301217 
    12311218extern  vmCvar_t  g_slapKnockback; 
     
    12411228extern vmCvar_t g_cheatAdminLevel; // an admin above or equal this level can use cheat, disable if 0 
    12421229 
    1243 extern vmCvar_t  g_playerVotePercent; 
    1244 extern vmCvar_t  g_globalVotePercent; 
     1230extern  vmCvar_t  wbpguid; // woolball command target public guid 
    12451231 
    12461232void      trap_Printf( const char *fmt ); 
  • src/game/g_main.c

    r122 r1  
    2323 
    2424#include "g_local.h" 
    25  
    26 #include "../qcommon/q_shared.h" 
    2725 
    2826level_locals_t  level; 
     
    4240gclient_t   g_clients[ MAX_CLIENTS ]; 
    4341 
    44 vmCvar_t  g_version; 
    4542vmCvar_t  g_fraglimit; 
    4643vmCvar_t  g_timelimit; 
     
    5249vmCvar_t  g_friendlyFireHumans; 
    5350vmCvar_t  g_friendlyBuildableFire; 
    54 vmCvar_t  g_friendlyFireMovementAttacks; 
    5551vmCvar_t  g_password; 
    5652vmCvar_t  g_needpass; 
     
    6359vmCvar_t  g_knockback; 
    6460vmCvar_t  g_quadfactor; 
     61vmCvar_t  g_forcerespawn; 
    6562vmCvar_t  g_inactivity; 
    6663vmCvar_t  g_debugMove; 
     
    8885vmCvar_t  g_smoothClients; 
    8986vmCvar_t  pmove_fixed; 
     87vmCvar_t  pmove_msec; 
    9088vmCvar_t  g_rankings; 
    91 vmCvar_t  pmove_msec; 
    9289vmCvar_t  g_listEntity; 
    9390vmCvar_t  g_minCommandPeriod; 
    9491vmCvar_t  g_minNameChangePeriod; 
    9592vmCvar_t  g_maxNameChanges; 
    96 vmCvar_t  g_newbieNumbering; 
    97 vmCvar_t  g_newbieNamePrefix; 
    9893 
    9994vmCvar_t  g_reactorBuildPoints; 
     
    130125vmCvar_t  g_shove; 
    131126 
     127vmCvar_t  g_maxWarp; 
     128vmCvar_t  g_skipCorrection; 
     129 
    132130vmCvar_t  g_mapConfigs; 
    133131vmCvar_t  g_chatTeamPrefix; 
     
    141139vmCvar_t  g_adminParseSay; 
    142140vmCvar_t  g_adminNameProtect; 
    143 vmCvar_t  g_autoRegister; 
    144141vmCvar_t  g_adminTempBan; 
    145142vmCvar_t  g_minLevelToSpecMM1; 
    146 vmCvar_t  g_adminWarnMessage; 
    147143 
    148144vmCvar_t  g_privateMessages; 
    149 vmCvar_t  g_publicSayadmins; 
    150145vmCvar_t  g_floodProtection; 
    151146 
     
    154149 
    155150vmCvar_t  g_tag; 
    156  
    157 vmCvar_t  g_allowActions; 
    158 vmCvar_t  g_actionPrefix; 
    159151 
    160152vmCvar_t  g_hiddenClients; 
     
    174166vmCvar_t  g_grangerMode; 
    175167vmCvar_t  g_repeaterOnReactor; 
    176 vmCvar_t  g_jetpackLimit; 
    177  
    178 vmCvar_t  g_playerVotePercent; 
    179 vmCvar_t  g_globalVotePercent; 
     168 
     169vmCvar_t  wbpguid; 
    180170 
    181171static cvarTable_t   gameCvarTable[ ] = 
     
    194184  // latched vars 
    195185 
    196   { &g_version, "g_version", FULL_VERSION, CVAR_SERVERINFO | CVAR_ROM, 0, qfalse  }, 
    197  
    198186  { &g_maxclients, "sv_maxclients", "12", CVAR_SERVERINFO | CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse  }, 
    199187  { &g_maxGameClients, "g_maxGameClients", "0", CVAR_SERVERINFO | CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse  }, 
    200188 
    201189  // change anytime vars 
    202   { &g_maxGameClients, "g_maxGameClients", "0", CVAR_SERVERINFO | CVAR_ARCHIVE, 0, qfalse  }, 
    203  
    204190  { &g_timelimit, "timelimit", "0", CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_NORESTART, 0, qtrue }, 
    205191  { &g_suddenDeathTime, "g_suddenDeathTime", "0", CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_NORESTART, 0, qtrue }, 
    206192  { &g_suddenDeathMode, "g_suddenDeathMode", "0", CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_NORESTART, 0, qtrue }, 
    207   { &g_playerVotePercent, "g_playerVotePercent", "55", CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_NORESTART, 0, qtrue }, 
    208   { &g_globalVotePercent, "g_globalVotePercent", "65", CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_NORESTART, 0, qtrue }, 
    209193 
    210194  { &g_synchronousClients, "g_synchronousClients", "0", CVAR_SYSTEMINFO, 0, qfalse  }, 
     
    214198  { &g_friendlyFireHumans, "g_friendlyFireHumans", "1", CVAR_ARCHIVE, 0, qtrue  }, 
    215199  { &g_friendlyBuildableFire, "g_friendlyBuildableFire", "1", CVAR_ARCHIVE, 0, qtrue  }, 
    216   { &g_friendlyFireMovementAttacks, "g_friendlyFireMovementAttacks", "1", CVAR_ARCHIVE, 0, qtrue  }, 
    217200 
    218201  { &g_teamAutoJoin, "g_teamAutoJoin", "0", CVAR_ARCHIVE  }, 
     
    240223  { &g_weaponRespawn, "g_weaponrespawn", "5", 0, 0, qtrue  }, 
    241224  { &g_weaponTeamRespawn, "g_weaponTeamRespawn", "30", 0, 0, qtrue }, 
     225  { &g_forcerespawn, "g_forcerespawn", "20", 0, 0, qtrue }, 
    242226  { &g_inactivity, "g_inactivity", "0", 0, 0, qtrue }, 
    243227  { &g_debugMove, "g_debugMove", "0", 0, 0, qfalse }, 
     
    256240  { &g_minNameChangePeriod, "g_minNameChangePeriod", "5", 0, 0, qfalse}, 
    257241  { &g_maxNameChanges, "g_maxNameChanges", "5", 0, 0, qfalse}, 
    258   { &g_newbieNumbering, "g_newbieNumbering", "0", CVAR_ARCHIVE, 0, qfalse}, 
    259   { &g_newbieNamePrefix, "g_newbieNamePrefix", "Newbie#", CVAR_ARCHIVE, 0, qfalse}, 
    260242 
    261243  { &g_smoothClients, "g_smoothClients", "1", 0, 0, qfalse}, 
     
    298280  { &g_shove, "g_shove", "0.0", CVAR_ARCHIVE, 0, qfalse  }, 
    299281 
     282  { &g_maxWarp, "g_maxWarp", "3", CVAR_ARCHIVE, 0, qfalse  }, 
     283  { &g_skipCorrection, "g_skipCorrection", "1", CVAR_ARCHIVE, 0, qfalse  }, 
     284 
    300285  { &g_mapConfigs, "g_mapConfigs", "mapconfigs", CVAR_ARCHIVE, 0, qfalse  }, 
    301286  { NULL, "g_mapConfigsLoaded", "0", CVAR_ROM, 0, qfalse  }, 
     
    309294  { &g_adminNameProtect, "g_adminNameProtect", "1", CVAR_ARCHIVE, 0, qfalse  }, 
    310295  { &g_adminTempBan, "g_adminTempBan", "120", CVAR_ARCHIVE, 0, qfalse  }, 
    311   { &g_adminWarnMessage, "g_adminWarnMessage", "You have been warned by an administrator.\n Cease imeediately or face admin action!\n", CVAR_ARCHIVE, 0, qfalse }, 
    312   { &g_autoRegister, "g_autoRegister", "0", CVAR_ARCHIVE, 0, qfalse  }, 
    313296   
    314297  { &g_privateMessages, "g_privateMessages", "1", CVAR_ARCHIVE, 0, qfalse  }, 
    315   { &g_publicSayadmins, "g_publicSayadmins", "1", CVAR_ARCHIVE, 0, qfalse  }, 
    316298  { &g_minLevelToSpecMM1, "g_minLevelToSpecMM1", "0", CVAR_ARCHIVE, 0, qfalse  }, 
    317299  { &g_floodProtection, "g_floodProtection", "150", CVAR_ARCHIVE, 0, qfalse  }, 
     
    332314  { &g_noBaseAttack, "g_noBaseAttack", "0", 0, 0, qfalse}, 
    333315  { &g_cheatAdminLevel, "g_cheatAdminLevel", "0", CVAR_SERVERINFO, 0, qfalse}, 
     316  { &wbpguid, "wbpguid", "", CVAR_ARCHIVE, 0, qfalse }, 
    334317   
    335318  { &g_allowDonate, "g_allowDonate", "1", CVAR_ARCHIVE, 0, qfalse}, 
     
    337320  { &g_allowShare, "g_allowShare", "1", CVAR_ARCHIVE, 0, qfalse}, 
    338321  { &g_grangerMode, "g_grangerMode", "0", 0, 0, qfalse }, 
    339   { &g_repeaterOnReactor, "g_repeaterOnReactor", "1", 0, 0, qfalse }, 
    340   { &g_jetpackLimit, "g_jetpackLimit", "40", 0, 0, qfalse }, 
    341   { &g_allowActions, "g_allowActions", "1", CVAR_ARCHIVE, 0, qfalse }, 
    342   { &g_actionPrefix, "g_actionPrefix", "***", CVAR_ARCHIVE, 0, qfalse } 
     322  { &g_repeaterOnReactor, "g_repeaterOnReactor", "1", 0, 0, qfalse } 
    343323}; 
    344324 
     
    405385    case GAME_CONSOLE_COMMAND: 
    406386      return ConsoleCommand( ); 
    407  
    408     case GAME_PING_OVERRIDE: 
    409       return ClientPingOverride( ); 
    410387  } 
    411388 
     
    714691  G_FindTeams( ); 
    715692 
     693  //TA: 
    716694  BG_InitClassOverrides( ); 
    717695  BG_InitBuildableOverrides( ); 
     
    741719  G_RemapTeamShaders( ); 
    742720 
    743   // so the server counts the spawns without a client attached 
     721  //TA: so the server counts the spawns without a client attached 
    744722  G_CountSpawns( ); 
    745723 
     
    12201198  level.overmindPresent = qfalse; 
    12211199 
    1222   for( i = 1, ent = g_entities + i ; i < level.num_entities && g_zoneBuildPoints.integer ; i++, ent++ ) 
     1200  for( i = 1, ent = g_entities + i ; i < level.num_entities ; i++, ent++ ) 
    12231201  { 
    12241202    buildable = ent->s.modelindex; 
     
    12561234        buildPoints = BG_FindBuildPointsForBuildable( buildable ); 
    12571235 
    1258         if(g_zoneBuildPoints.integer && ent->parentNode && ent->s.modelindex != BA_A_SPAWN) 
    1259         { 
    1260           if(ent->parentNode->buildpoints >= buildPoints) 
    1261             ent->parentNode->buildpoints -= buildPoints; 
    1262           else 
    1263             ent->powered = 0; 
    1264         } 
     1236                if(ent->parentNode && ent->s.modelindex != BA_A_SPAWN) 
     1237                  ent->parentNode->buildpoints -= buildPoints; 
    12651238 
    12661239        if( BG_FindTeamForBuildable( buildable ) == BIT_HUMANS ) 
     
    16881661    G_AdvanceMapRotation( ); 
    16891662  else 
    1690     trap_SendConsoleCommand( EXEC_APPEND, "restartmap\n" ); 
     1663    trap_SendConsoleCommand( EXEC_APPEND, "map_restart\n" ); 
    16911664 
    16921665  level.restarted = qtrue; 
     
    21172090} 
    21182091 
    2119 /* 
    2120 ================== 
    2121 G_Vote 
    2122 ================== 
    2123 */ 
    2124 void G_Vote( gentity_t *ent, qboolean voting ) 
    2125 { 
    2126   if( !level.voteTime ) 
    2127     return; 
    2128  
    2129   if( voting ) 
    2130   { 
    2131     if( ent->client->ps.eFlags & EF_VOTED ) 
    2132       return; 
    2133     ent->client->ps.eFlags |= EF_VOTED; 
    2134   } 
    2135   else 
    2136   { 
    2137     if( !( ent->client->ps.eFlags & EF_VOTED ) ) 
    2138       return; 
    2139     ent->client->ps.eFlags &= ~EF_VOTED; 
    2140   } 
    2141  
    2142   if( ent->client->pers.vote ) 
    2143   { 
    2144     if( voting ) 
    2145       level.voteYes++; 
    2146     else 
    2147       level.voteYes--; 
    2148     trap_SetConfigstring( CS_VOTE_YES, va( "%d", level.voteYes ) ); 
    2149   } 
    2150   else 
    2151   { 
    2152     if( voting ) 
    2153       level.voteNo++; 
    2154     else 
    2155       level.voteNo--; 
    2156     trap_SetConfigstring( CS_VOTE_NO, va( "%d", level.voteNo ) ); 
    2157   } 
    2158 } 
    2159  
    2160 /* 
    2161 ================== 
    2162 G_TeamVote 
    2163 ================== 
    2164 */ 
    2165 void G_TeamVote( gentity_t *ent, qboolean voting ) 
    2166 { 
    2167   int cs_offset; 
    2168  
    2169   if( ent->client->pers.teamSelection == PTE_HUMANS ) 
    2170     cs_offset = 0; 
    2171   else if( ent->client->pers.teamSelection == PTE_ALIENS ) 
    2172     cs_offset = 1; 
    2173   else 
    2174     return; 
    2175  
    2176   if( !level.teamVoteTime[ cs_offset ] ) 
    2177     return; 
    2178  
    2179   if( voting ) 
    2180   { 
    2181     if( ent->client->ps.eFlags & EF_TEAMVOTED ) 
    2182       return; 
    2183     ent->client->ps.eFlags |= EF_TEAMVOTED; 
    2184   } 
    2185   else 
    2186   { 
    2187     if( !( ent->client->ps.eFlags & EF_TEAMVOTED ) ) 
    2188       return; 
    2189     ent->client->ps.eFlags &= ~EF_TEAMVOTED; 
    2190   } 
    2191  
    2192   if( ent->client->pers.teamVote ) 
    2193   { 
    2194     if( voting ) 
    2195       level.teamVoteYes[ cs_offset ]++; 
    2196     else 
    2197       level.teamVoteYes[ cs_offset ]--; 
    2198     trap_SetConfigstring( CS_TEAMVOTE_YES + cs_offset, 
    2199       va( "%d", level.teamVoteYes[ cs_offset ] ) ); 
    2200   } 
    2201   else 
    2202   { 
    2203     if( voting ) 
    2204       level.teamVoteNo[ cs_offset ]++; 
    2205     else 
    2206       level.teamVoteNo[ cs_offset ]--; 
    2207     trap_SetConfigstring( CS_TEAMVOTE_NO + cs_offset, 
    2208       va( "%d", level.teamVoteNo[ cs_offset ] ) ); 
    2209   } 
    2210 } 
    22112092 
    22122093 
     
    22272108void CheckVote( void ) 
    22282109{ 
    2229   double percent; 
    2230  
    22312110  if( level.voteExecuteTime && level.voteExecuteTime < level.time ) 
    22322111  { 
     
    22342113 
    22352114    trap_SendConsoleCommand( EXEC_APPEND, va( "%s\n", level.voteString ) ); 
    2236     if( !Q_stricmp( level.voteString, "restartmap" ) || 
     2115    if( !Q_stricmp( level.voteString, "map_restart" ) || 
    22372116        !Q_stricmpn( level.voteString, "map", 3 ) ) 
    22382117    { 
     
    22402119    } 
    22412120  } 
    2242  
    2243   if (strstr(level.voteString, "mute") || strstr(level.voteString, "unmute") || strstr(level.voteString, "kick")) 
    2244     percent = g_playerVotePercent.integer; 
    2245   else  
    2246     percent = g_globalVotePercent.integer; 
    22472121 
    22482122  if( !level.voteTime ) 
    22492123    return; 
    22502124 
    2251 // warning: not sure about > or >= 
    2252  
    22532125  if( level.time - level.voteTime >= VOTE_TIME ) 
    22542126  { 
    2255     if( level.voteYes >= rint ( (level.numVotingClients * percent) / 100 ) ) 
     2127    if( level.voteYes > level.voteNo ) 
    22562128    { 
    22572129      // execute the command, then remove the vote 
     
    22672139  else 
    22682140  { 
    2269     if( level.voteYes >= rint ( (level.numVotingClients * percent) / 100 ) ) 
     2141    if( level.voteYes > level.numVotingClients / 2 ) 
    22702142    { 
    22712143      // execute the command, then remove the vote 
     
    22732145      level.voteExecuteTime = level.time + 3000; 
    22742146    } 
    2275     else if( level.voteNo > rint ( (level.numVotingClients * (100 - percent) ) / 100 ) ) 
     2147    else if( level.voteNo >= level.numVotingClients / 2 ) 
    22762148    { 
    22772149      // same behavior as a timeout 
     
    23462218  if( level.time - level.teamVoteTime[ cs_offset ] >= VOTE_TIME ) 
    23472219  { 
    2348     G_TeamCommand( team, "print \"Team vote failed\n\"" ); 
     2220    trap_SendServerCommand( -1, "print \"Team vote failed\n\"" ); 
    23492221  } 
    23502222  else 
     
    23532225    { 
    23542226      // execute the command, then remove the vote 
    2355       G_TeamCommand( team, "print \"Team vote passed\n\"" ); 
     2227      trap_SendServerCommand( -1, "print \"Team vote passed\n\"" ); 
     2228      // 
    23562229      trap_SendConsoleCommand( EXEC_APPEND, va( "%s\n", level.teamVoteString[ cs_offset ] ) ); 
    23572230    } 
     
    23592232    { 
    23602233      // same behavior as a timeout 
    2361       G_TeamCommand( team, "print \"Team vote failed\n\"" ); 
     2234      trap_SendServerCommand( -1, "print \"Team vote failed\n\"" ); 
    23622235    } 
    23632236    else 
     
    24852358  msec = level.time - level.previousTime; 
    24862359 
    2487   // seed the rng 
     2360  //TA: seed the rng 
    24882361  srand( level.framenum ); 
    24892362 
     
    25342407      continue; 
    25352408 
    2536     // calculate the acceleration of this entity 
     2409    //TA: calculate the acceleration of this entity 
    25372410    if( ent->evaluateAcceleration ) 
    25382411      G_EvaluateAcceleration( ent, msec ); 
     
    25912464  end = trap_Milliseconds(); 
    25922465 
     2466  //TA: 
    25932467  G_CountSpawns( ); 
    25942468  G_CalculateBuildPoints( ); 
  • src/game/g_maprotation.c

    r118 r0  
    2727 
    2828static mapRotations_t mapRotations; 
    29  
    30 /* 
    31 =============== 
    32 G_MapExists 
    33  
    34 Check if a map exists 
    35 =============== 
    36 */ 
    37 static qboolean G_MapExists( char *name ) 
    38 { 
    39   fileHandle_t  f; 
    40  
    41   if( trap_FS_FOpenFile( va( "maps/%s.bsp", name ), &f, FS_READ ) > 0 ) 
    42   { 
    43     trap_FS_FCloseFile( f ); 
    44     return qtrue; 
    45   } 
    46   else 
    47     return qfalse; 
    48 } 
    49  
    50 /* 
    51 =============== 
    52 G_RotationExists 
    53  
    54 Check if a rotation exists 
    55 =============== 
    56 */ 
    57 static qboolean G_RotationExists( char *name ) 
    58 { 
    59   int i; 
    60  
    61   for( i = 0; i < mapRotations.numRotations; i++ ) 
    62   { 
    63     if( Q_strncmp( mapRotations.rotations[ i ].name, name, MAX_QPATH ) == 0 ) 
    64       return qtrue; 
    65   } 
    66  
    67   return qfalse; 
    68 } 
    6929 
    7030/* 
     
    309269{ 
    310270  char          *text_p; 
    311   int           i, j, k; 
     271  int           i; 
    312272  int           len; 
    313273  char          *token; 
     
    368328        } 
    369329 
    370         //start parsing map rotations again 
     330        //start parsing particle systems again 
    371331        mrNameSet = qfalse; 
    372332 
     
    401361  } 
    402362 
    403   for( i = 0; i < mapRotations.numRotations; i++ ) 
    404   { 
    405     for( j = 0; j < mapRotations.rotations[ i ].numMaps; j++ ) 
    406     { 
    407       if( !G_MapExists( mapRotations.rotations[ i ].maps[ j ].name ) ) 
    408       { 
    409         G_Printf( S_COLOR_RED "ERROR: map \"%s\" doesn't exist\n", 
    410           mapRotations.rotations[ i ].maps[ j ].name ); 
    411         return qfalse; 
    412       } 
    413  
    414       for( k = 0; k < mapRotations.rotations[ i ].maps[ j ].numConditions; k++ ) 
    415       { 
    416         if( !G_MapExists( mapRotations.rotations[ i ].maps[ j ].conditions[ k ].dest ) && 
    417             !G_RotationExists( mapRotations.rotations[ i ].maps[ j ].conditions[ k ].dest ) ) 
    418         { 
    419           G_Printf( S_COLOR_RED "ERROR: conditional destination \"%s\" doesn't exist\n", 
    420             mapRotations.rotations[ i ].maps[ j ].conditions[ k ].dest ); 
    421           return qfalse; 
    422         } 
    423  
    424       } 
    425  
    426     } 
    427   } 
    428  
    429363  return qtrue; 
    430364} 
     
    610544  } 
    611545 
     546  //this should probably be prevented by a 2nd pass at compile time 
     547  //but i'm lazy (FIXME) 
    612548  return MCT_ERR; 
    613549} 
  • src/game/g_misc.c

    r122 r0  
    328328void SP_misc_anim_model( gentity_t *self ) 
    329329{ 
    330   self->s.powerups      = (int)self->animation[ 0 ]; 
     330  self->s.powerups  = (int)self->animation[ 0 ]; 
    331331  self->s.weapon    = (int)self->animation[ 1 ]; 
    332332  self->s.torsoAnim = (int)self->animation[ 2 ]; 
  • src/game/g_missile.c

    r118 r0  
    8383  ent->s.eType = ET_GENERAL; 
    8484 
     85  //TA: tired... can't be fucked... hack 
    8586  if( ent->s.weapon != WP_LOCKBLOB_LAUNCHER && 
    8687      ent->s.weapon != WP_FLAMER ) 
  • src/game/g_mover.c

    r122 r0  
    13351335  vec3_t    mins, maxs; 
    13361336  int       i, best; 
     1337 
     1338  //TA: disable shootable doors 
     1339  // set all of the slaves as shootable 
     1340  //for( other = ent; other; other = other->teamchain ) 
     1341  //  other->takedamage = qtrue; 
    13371342 
    13381343  // find the bounds of everything on the team 
     
    17081713  VectorClear( ent->s.apos.trDelta ); 
    17091714 
    1710   ent->s.powerups   = (int)ent->animation[ 0 ];                  //first frame 
    1711   ent->s.weapon = abs( (int)ent->animation[ 1 ] );           //number of frames 
     1715  ent->s.powerups  = (int)ent->animation[ 0 ];                  //first frame 
     1716  ent->s.weapon    = abs( (int)ent->animation[ 1 ] );           //number of frames 
    17121717 
    17131718  //must be at least one frame -- mapper has forgotten animation key 
  • src/game/g_physics.c

    r118 r0  
    6363  { 
    6464    VectorMA( trace->endpos, 0.5f, trace->plane.normal, trace->endpos ); // make sure it is off ground 
     65    // Never allow origin to be snapped lower (buildables fall through map bug) 
     66    trace->endpos[2] = (float)ceil(trace->endpos[2]); 
     67    SnapVector( trace->endpos ); 
    6568    G_SetOrigin( ent, trace->endpos ); 
    6669    ent->s.groundEntityNum = trace->entityNum; 
  • src/game/g_public.h

    r122 r1  
    2424// g_public.h -- game module information visible to server 
    2525 
    26 #define GAME_API_VERSION  9 
     26#define GAME_API_VERSION  8 
    2727 
    2828// entity->svFlags 
     
    3232#define SVF_NOCLIENT            0x00000001  // don't send entity to clients, even if it has effects 
    3333 
     34// TTimo 
     35// https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=551 
    3436#define SVF_CLIENTMASK 0x00000002 
    3537 
     
    114116  G_CVAR_UPDATE,  // ( vmCvar_t *vmCvar ); 
    115117  G_CVAR_SET,   // ( const char *var_name, const char *value ); 
    116   G_CVAR_VARIABLE_VALUE,  // ( const char *var_name ); 
    117118  G_CVAR_VARIABLE_INTEGER_VALUE,  // ( const char *var_name ); 
    118119 
     
    253254  GAME_RUN_FRAME,         // ( int levelTime ); 
    254255 
    255   GAME_CONSOLE_COMMAND,      // ( void ); 
     256  GAME_CONSOLE_COMMAND      // ( void ); 
    256257  // ConsoleCommand will be called when a command has been issued 
    257258  // that is not recognized as a builtin function. 
    258259  // The game can issue trap_argc() / trap_argv() commands to get the command 
    259260  // and parameters.  Return qfalse if the game doesn't recognize it as a command. 
    260  
    261   GAME_PING_OVERRIDE        // ( void ), guid retrieved through trap_Argc and trap_Argv 
    262   // returns 1 if the client overrides ping restrictions 
    263261} gameExport_t; 
    264262 
  • src/game/g_session.c

    r122 r1  
    7575  char  s[ MAX_STRING_CHARS ]; 
    7676  const char  *var; 
     77 
     78  // bk001205 - format 
    7779  int teamLeader; 
    7880  int spectatorState; 
     
    9799    &client->sess.ignoreList.lo 
    98100    ); 
    99  
     101  // bk001205 - format issues 
    100102  client->sess.sessionTeam = (team_t)sessionTeam; 
    101103  client->sess.restartTeam = (pTeam_t)restartTeam; 
     
    154156  int    i; 
    155157 
    156   //FIXME: What's this for? 
     158  //TA: ? 
    157159  trap_Cvar_Set( "session", va( "%i", 0 ) ); 
    158160 
  • src/game/g_spawn.c

    r122 r1  
    235235  { "info_player_intermission", SP_info_player_intermission }, 
    236236 
     237  //TA: extra bits 
    237238  { "info_alien_intermission",  SP_info_alien_intermission }, 
    238239  { "info_human_intermission",  SP_info_human_intermission }, 
  • src/game/g_svcmds.c

    r122 r0  
    5252If 0, then only addresses matching the list will be allowed.  This lets you easily set up a private game, or a game that only allows players from your local network. 
    5353 
    54 For persistence, bans are stored in g_banIPs cvar MAX_CVAR_VALUE_STRING 
     54TTimo NOTE: for persistence, bans are stored in g_banIPs cvar MAX_CVAR_VALUE_STRING 
    5555The size of the cvar string buffer is limiting the banning to around 20 masks 
    5656this could be improved by putting some g_banIPs2 g_banIps3 etc. maybe 
     
    541541  Q_strncpyz( layouts, s, sizeof( layouts ) ); 
    542542  trap_Cvar_Set( "g_layouts", layouts );  
    543   trap_SendConsoleCommand( EXEC_APPEND, "restartmap\n" ); 
     543  trap_SendConsoleCommand( EXEC_APPEND, "map_restart\n" ); 
    544544  level.restarted = qtrue; 
    545545} 
     
    732732      return qtrue; 
    733733    } 
    734     else if( !Q_stricmp( cmd, "a" ) || !Q_stricmp( cmd, "say_admins" )) 
    735     { 
    736       G_Say( NULL, NULL, SAY_ADMINS, ConcatArgs( 1 )  ); 
    737       return qtrue; 
    738     } 
     734 
    739735    G_Printf( "unknown command: %s\n", cmd ); 
    740736    return qtrue; 
  • src/game/g_syscalls.c

    r114 r0  
    111111} 
    112112 
    113 float trap_Cvar_VariableValue( const char *var_name ) 
    114 { 
    115   int temp; 
    116   temp = syscall( G_CVAR_VARIABLE_VALUE, var_name ); 
    117   return (*(float*)&temp); 
    118 } 
    119  
    120113int trap_Cvar_VariableIntegerValue( const char *var_name ) 
    121114{ 
  • src/game/g_team.c

    r118 r0  
    146146 
    147147Format: 
    148   clientNum location health armor weapon misc 
     148  clientNum location health armor weapon powerups 
    149149 
    150150================== 
     
    196196 
    197197      Com_sprintf( entry, sizeof( entry ), 
    198         " %i %i %i %i %i", 
     198        " %i %i %i %i %i %i", 
     199//        level.sortedClients[i], player->client->pers.teamState.location, h, a, 
    199200        i, player->client->pers.teamState.location, h, a, 
    200         player->client->ps.weapon ); 
     201        player->client->ps.weapon, player->s.powerups ); 
    201202 
    202203      j = strlen( entry ); 
  • src/game/g_trigger.c

    r122 r0  
    11001100 
    11011101  BG_FindAmmoForWeapon( other->client->ps.weapon, &maxAmmo, &maxClips ); 
    1102   BG_UnpackAmmoArray( other->client->ps.weapon, other->client->ps.ammo, other->client->ps.powerups, &ammo, &clips ); 
     1102  BG_UnpackAmmoArray( other->client->ps.weapon, other->client->ps.ammo, other->client->ps.powerups, 
     1103                      &ammo, &clips ); 
    11031104 
    11041105  if( ( ammo + self->damage ) > maxAmmo ) 
     
    11151116    ammo += self->damage; 
    11161117 
    1117   BG_PackAmmoArray( other->client->ps.weapon, other->client->ps.ammo, other->client->ps.powerups, ammo, clips ); 
     1118  BG_PackAmmoArray( other->client->ps.weapon, other->client->ps.ammo, other->client->ps.powerups, 
     1119                    ammo, clips ); 
    11181120} 
    11191121 
  • src/game/g_utils.c

    r122 r0  
    123123} 
    124124 
     125//TA: added ParticleSystemIndex 
    125126int G_ParticleSystemIndex( char *name ) 
    126127{ 
     
    128129} 
    129130 
     131//TA: added ShaderIndex 
    130132int G_ShaderIndex( char *name ) 
    131133{ 
     
    163165      if( level.clients[ i ].pers.teamSelection == team || 
    164166        ( level.clients[ i ].pers.teamSelection == PTE_NONE && 
    165           G_admin_permission( &g_entities[ i ], ADMF_SPEC_ALLCHAT ) ) || 
    166         ( level.clients[ i ].pers.teamSelection == PTE_NONE && 
    167           level.clients[ i ].sess.spectatorState == SPECTATOR_FOLLOW && 
    168           level.clients[ i ].sess.spectatorClient >= 0 && 
    169           level.clients[ level.clients[ i ].sess.spectatorClient ].pers.teamSelection == team ) ) 
     167          G_admin_permission( &g_entities[ i ], ADMF_SPEC_ALLCHAT ) ) ) 
    170168        trap_SendServerCommand( i, cmd ); 
    171169    } 
     
    596594      continue; 
    597595 
    598     // impossible to telefrag self 
     596    //TA: impossible to telefrag self 
    599597    if( ent == hit ) 
    600598      continue; 
     
    740738 
    741739  VectorCopy( origin, ent->r.currentOrigin ); 
    742   VectorCopy( origin, ent->s.origin ); 
    743 } 
    744  
    745 // from quakestyle.telefragged.com 
     740  VectorCopy( origin, ent->s.origin ); //TA: if shit breaks - blame this line 
     741} 
     742 
     743//TA: from quakestyle.telefragged.com 
    746744// (NOBODY): Code helper function 
    747745// 
  • src/game/g_weapon.c

    r122 r1  
    4343    ent->client->ps.pm_flags |= PMF_WEAPON_SWITCH; 
    4444 
    45     if( weapon == WP_NONE || 
    46         !BG_InventoryContainsWeapon( weapon, ent->client->ps.stats )) 
     45    if( weapon == WP_NONE  
     46      || !BG_InventoryContainsWeapon( weapon, ent->client->ps.stats )) 
    4747    { 
    4848      //switch to the first non blaster weapon 
     
    6565    else 
    6666      ent->client->ps.persistant[ PERS_NEWWEAPON ] = weapon; 
    67  
    68     // force this here to prevent flamer effect from continuing 
     67    
     68    // force this here to prevent flamer effect from continuing  
    6969    ent->client->ps.generic1 = WPM_NOTFIRING; 
    7070 
     
    100100      if( buyingEnergyAmmo ) 
    101101      { 
    102         ent->client->jetpack_power = g_jetpackLimit.integer; 
    103  
    104102        G_AddEvent( ent, EV_RPTUSE_SOUND, 0 ); 
    105103 
     
    108106      } 
    109107 
    110       BG_PackAmmoArray( i, ent->client->ps.ammo, ent->client->ps.powerups, maxAmmo, maxClips ); 
     108      BG_PackAmmoArray( i, ent->client->ps.ammo, ent->client->ps.powerups, 
     109                        maxAmmo, maxClips ); 
    111110 
    112111      restoredAmmo = qtrue; 
     
    134133  VectorNormalize(newv); 
    135134  VectorMA(impact, 8192, newv, endout); 
    136 } 
    137  
    138 /* 
    139 ================ 
    140 G_WideTrace 
    141  
    142 Trace a bounding box against entities, but not the world 
    143 Also check there is a line of sight between the start and end point 
    144 ================ 
    145 */ 
    146 static void G_WideTrace( trace_t *tr, gentity_t *ent, float range, float width, gentity_t **target ) 
    147 { 
    148   vec3_t    mins, maxs; 
    149   vec3_t    end; 
    150  
    151   VectorSet( mins, -width, -width, -width ); 
    152   VectorSet( maxs, width, width, width ); 
    153  
    154   *target = NULL; 
    155  
    156   if( !ent->client ) 
    157     return; 
    158  
    159   // Set aiming directions 
    160   AngleVectors( ent->client->ps.viewangles, forward, right, up ); 
    161   CalcMuzzlePoint( ent, forward, right, up, muzzle ); 
    162   VectorMA( muzzle, range, forward, end ); 
    163  
    164   G_UnlaggedOn( muzzle, range ); 
    165  
    166   // Trace against entities 
    167   trap_Trace( tr, muzzle, mins, maxs, end, ent->s.number, CONTENTS_BODY ); 
    168   if( tr->entityNum != ENTITYNUM_NONE ) 
    169   { 
    170     *target = &g_entities[ tr->entityNum ]; 
    171  
    172     // Set range to the trace length plus the width, so that the end of the 
    173     // LOS trace is close to the exterior of the target's bounding box 
    174     range = Distance( muzzle, tr->endpos ) + width; 
    175     VectorMA( muzzle, range, forward, end ); 
    176  
    177     // Trace for line of sight against the world 
    178     trap_Trace( tr, muzzle, NULL, NULL, end, 0, CONTENTS_SOLID ); 
    179     if( tr->fraction < 1.0f ) 
    180       *target = NULL; 
    181   } 
    182  
    183   G_UnlaggedOff( ); 
    184135} 
    185136 
     
    215166{ 
    216167  trace_t   tr; 
     168  vec3_t    end; 
    217169  gentity_t *tent; 
    218170  gentity_t *traceEnt; 
    219  
    220   G_WideTrace( &tr, ent, range, width, &traceEnt ); 
    221  
    222   if( traceEnt == NULL ) 
     171  vec3_t    mins, maxs; 
     172 
     173  VectorSet( mins, -width, -width, -width ); 
     174  VectorSet( maxs, width, width, width ); 
     175 
     176  // set aiming directions 
     177  AngleVectors( ent->client->ps.viewangles, forward, right, up ); 
     178 
     179  CalcMuzzlePoint( ent, forward, right, up, muzzle ); 
     180 
     181  VectorMA( muzzle, range, forward, end ); 
     182 
     183  G_UnlaggedOn( muzzle, range ); 
     184  trap_Trace( &tr, muzzle, mins, maxs, end, ent->s.number, MASK_SHOT ); 
     185  G_UnlaggedOff( ); 
     186 
     187  if( tr.surfaceFlags & SURF_NOIMPACT ) 
    223188    return; 
     189 
     190  traceEnt = &g_entities[ tr.entityNum ]; 
    224191 
    225192  // send blood impact 
     
    802769          BG_FindBuildDelayForWeapon( ent->s.weapon ) * 2; 
    803770      } 
    804       else if( ent->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS && 
    805                G_IsPowered( muzzle ) == BA_NONE && 
    806                ( ent->client->ps.stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT ) != BA_H_REPEATER ) //hack 
     771      else if( ent->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS && !G_IsPowered( muzzle ) && 
     772          ( ent->client->ps.stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT ) != BA_H_REPEATER ) //hack 
    807773      { 
    808774        ent->client->ps.stats[ STAT_MISC ] += 
     
    851817{ 
    852818  trace_t   tr; 
     819  vec3_t    end; 
    853820  gentity_t *tent; 
    854821  gentity_t *traceEnt; 
     822  vec3_t    mins, maxs; 
    855823  int       damage = LEVEL0_BITE_DMG; 
    856824 
    857   G_WideTrace( &tr, ent, LEVEL0_BITE_RANGE, LEVEL0_BITE_WIDTH, &traceEnt ); 
    858  
    859   if( traceEnt == NULL ) 
     825  VectorSet( mins, -LEVEL0_BITE_WIDTH, -LEVEL0_BITE_WIDTH, -LEVEL0_BITE_WIDTH ); 
     826  VectorSet( maxs, LEVEL0_BITE_WIDTH, LEVEL0_BITE_WIDTH, LEVEL0_BITE_WIDTH ); 
     827 
     828  // set aiming directions 
     829  AngleVectors( ent->client->ps.viewangles, forward, right, up ); 
     830 
     831  CalcMuzzlePoint( ent, forward, right, up, muzzle ); 
     832 
     833  VectorMA( muzzle, LEVEL0_BITE_RANGE, forward, end ); 
     834 
     835  G_UnlaggedOn( muzzle, LEVEL0_BITE_RANGE ); 
     836  trap_Trace( &tr, muzzle, mins, maxs, end, ent->s.number, MASK_SHOT ); 
     837  G_UnlaggedOff( ); 
     838 
     839  if( tr.surfaceFlags & SURF_NOIMPACT ) 
    860840    return qfalse; 
     841 
     842  traceEnt = &g_entities[ tr.entityNum ]; 
    861843 
    862844  if( !traceEnt->takedamage ) 
     
    12671249{ 
    12681250  trace_t   tr; 
     1251  vec3_t    end; 
    12691252  gentity_t *traceEnt; 
    1270  
    1271   G_WideTrace( &tr, ent, LEVEL2_AREAZAP_RANGE, LEVEL2_AREAZAP_WIDTH, &traceEnt ); 
    1272  
    1273   if( traceEnt == NULL ) 
     1253  vec3_t    mins, maxs; 
     1254 
     1255  VectorSet( mins, -LEVEL2_AREAZAP_WIDTH, -LEVEL2_AREAZAP_WIDTH, -LEVEL2_AREAZAP_WIDTH ); 
     1256  VectorSet( maxs, LEVEL2_AREAZAP_WIDTH, LEVEL2_AREAZAP_WIDTH, LEVEL2_AREAZAP_WIDTH ); 
     1257 
     1258  // set aiming directions 
     1259  AngleVectors( ent->client->ps.viewangles, forward, right, up ); 
     1260 
     1261  CalcMuzzlePoint( ent, forward, right, up, muzzle ); 
     1262 
     1263  VectorMA( muzzle, LEVEL2_AREAZAP_RANGE, forward, end ); 
     1264 
     1265  G_UnlaggedOn( muzzle, LEVEL2_AREAZAP_RANGE ); 
     1266  trap_Trace( &tr, muzzle, mins, maxs, end, ent->s.number, MASK_SHOT ); 
     1267  G_UnlaggedOff( ); 
     1268 
     1269  if( tr.surfaceFlags & SURF_NOIMPACT ) 
    12741270    return; 
     1271 
     1272  traceEnt = &g_entities[ tr.entityNum ]; 
    12751273 
    12761274  if( ( ( traceEnt->client && traceEnt->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) || 
     
    12991297{ 
    13001298  trace_t   tr; 
     1299  vec3_t    end; 
    13011300  gentity_t *tent; 
    13021301  gentity_t *traceEnt; 
    13031302  int       damage; 
     1303  vec3_t    mins, maxs; 
     1304 
     1305  VectorSet( mins, -LEVEL3_POUNCE_WIDTH, -LEVEL3_POUNCE_WIDTH, -LEVEL3_POUNCE_WIDTH ); 
     1306  VectorSet( maxs, LEVEL3_POUNCE_WIDTH, LEVEL3_POUNCE_WIDTH, LEVEL3_POUNCE_WIDTH ); 
    13041307 
    13051308  if( ent->client->ps.groundEntityNum != ENTITYNUM_NONE ) 
     
    13151318    return qfalse; 
    13161319 
    1317   G_WideTrace( &tr, ent, LEVEL3_POUNCE_RANGE, LEVEL3_POUNCE_WIDTH, &traceEnt ); 
    1318  
    1319   if( traceEnt == NULL ) 
     1320  // set aiming directions 
     1321  AngleVectors( ent->client->ps.viewangles, forward, right, up ); 
     1322 
     1323  CalcMuzzlePoint( ent, forward, right, up, muzzle ); 
     1324 
     1325  VectorMA( muzzle, LEVEL3_POUNCE_RANGE, forward, end ); 
     1326 
     1327  G_UnlaggedOn( muzzle, LEVEL3_POUNCE_RANGE ); 
     1328  trap_Trace( &tr, muzzle, mins, maxs, end, ent->s.number, MASK_SHOT ); 
     1329  G_UnlaggedOff( ); 
     1330 
     1331  //miss 
     1332  if( tr.fraction >= 1.0 ) 
    13201333    return qfalse; 
     1334 
     1335  if( tr.surfaceFlags & SURF_NOIMPACT ) 
     1336    return qfalse; 
     1337 
     1338  traceEnt = &g_entities[ tr.entityNum ]; 
    13211339 
    13221340  // send blood impact 
     
    14121430void CalcMuzzlePoint( gentity_t *ent, vec3_t forward, vec3_t right, vec3_t up, vec3_t muzzlePoint ) 
    14131431{ 
    1414   vec3_t normal; 
    1415  
    14161432  VectorCopy( ent->s.pos.trBase, muzzlePoint ); 
    1417   BG_GetClientNormal( &ent->client->ps, normal ); 
    1418   VectorMA( muzzlePoint, ent->client->ps.viewheight, normal, muzzlePoint ); 
     1433  muzzlePoint[ 2 ] += ent->client->ps.viewheight; 
    14191434  VectorMA( muzzlePoint, 1, forward, muzzlePoint ); 
     1435  VectorMA( muzzlePoint, 1, right, muzzlePoint ); 
    14201436  // snap to integer coordinates for more efficient network bandwidth usage 
    14211437  SnapVector( muzzlePoint ); 
  • src/qcommon/cmd.c

    r63 r0  
    3939byte            cmd_text_buf[MAX_CMD_BUFFER]; 
    4040 
    41  
    42  
    43 // Delay stuff  
    44  
    45 #define MAX_DELAYED_COMMANDS    64  
    46 #define CMD_DELAY_FRAME_FIRE 1 
    47 #define CMD_DELAY_UNUSED 0 
    48  
    49 typedef enum 
    50 { 
    51   CMD_DELAY_MSEC, 
    52   CMD_DELAY_FRAME 
    53 } cmdDelayType_t; 
    54  
    55 typedef struct 
    56 {  
    57         char    text[MAX_CMD_LINE];  
    58         int     delay; 
    59         cmdDelayType_t  type; 
    60 } delayed_cmd_s;  
    61   
    62 delayed_cmd_s delayed_cmd[MAX_DELAYED_COMMANDS];  
    6341 
    6442//============================================================================= 
     
    246224 
    247225 
    248  
    249 /* 
    250 ============================================================================== 
    251  
    252                                                 COMMANDS DELAYING 
    253  
    254 ============================================================================== 
    255 */ 
    256  
    257  
    258 /* 
    259 =============== 
    260 Cdelay_Frame 
    261 =============== 
    262 */ 
    263  
    264 void Cdelay_Frame( void ) { 
    265         int i; 
    266         int sys_time = Sys_Milliseconds(); 
    267         qboolean run_it; 
    268          
    269         for(i=0; (i<MAX_DELAYED_COMMANDS); i++) 
    270         { 
    271                 run_it = qfalse; 
    272                  
    273                 if(delayed_cmd[i].delay == CMD_DELAY_UNUSED) 
    274                         continue; 
    275                  
    276                 //check if we should run the command (both type) 
    277                 if(delayed_cmd[i].type == CMD_DELAY_MSEC && delayed_cmd[i].delay < sys_time) 
    278                 {                        
    279                         run_it = qtrue; 
    280                 } else if(delayed_cmd[i].type == CMD_DELAY_FRAME) 
    281                 { 
    282                         delayed_cmd[i].delay --; 
    283                         if(delayed_cmd[i].delay == CMD_DELAY_FRAME_FIRE) 
    284                                 run_it = qtrue; 
    285                 } 
    286                  
    287                 if(run_it) 
    288                 { 
    289                         delayed_cmd[i].delay = CMD_DELAY_UNUSED; 
    290                         Cbuf_ExecuteText(EXEC_NOW, delayed_cmd[i].text); 
    291                 } 
    292         } 
    293 } 
    294  
    295  
    296  
    297  
    298226/* 
    299227============================================================================== 
     
    314242        int             len; 
    315243        char    filename[MAX_QPATH]; 
    316         int i; 
    317  
    318         if (Cmd_Argc () < 2) { 
    319                 Com_Printf ("exec <filename> (args) : execute a script file\n"); 
     244 
     245        if (Cmd_Argc () != 2) { 
     246                Com_Printf ("exec <filename> : execute a script file\n"); 
    320247                return; 
    321248        } 
     
    330257        Com_Printf ("execing %s\n",Cmd_Argv(1)); 
    331258         
    332         Cvar_Get( "arg_all", "", CVAR_TEMP | CVAR_ROM | CVAR_USER_CREATED ); 
    333         Cvar_Set( "arg_all", Cmd_ArgsFrom( 2 ) ); 
    334         Cvar_Get( "arg_count", "", CVAR_TEMP | CVAR_ROM | CVAR_USER_CREATED ); 
    335         Cvar_Set( "arg_count", va( "%i", Cmd_Argc() - 2 ) ); 
    336  
    337         for (i = Cmd_Argc() - 2; i; i--) 
    338         { 
    339                 Cvar_Get( va( "arg_%i", i ), "", CVAR_TEMP | CVAR_ROM | CVAR_USER_CREATED ); 
    340                 Cvar_Set( va( "arg_%i", i ), Cmd_Argv( i + 1 ) ); 
    341         } 
    342                  
    343259        Cbuf_InsertText (f); 
    344260 
     
    366282} 
    367283 
    368 /* 
    369 =============== 
    370 Cmd_If_f 
    371  
    372 Compares two cvars, if true vstr the third, if false vstr the forth 
    373 =============== 
    374 */ 
    375 void Cmd_If_f( void ) { 
    376   char  *v; 
    377   int   v1; 
    378   int   v2; 
    379   char  *vt; 
    380   char  *vf; 
    381   char  *op; 
    382  
    383   if ( (Cmd_Argc () == 6 ) || (Cmd_Argc () == 5) ) { 
    384     v1 = Cvar_VariableIntegerValue( Cmd_Argv( 1 ) ); 
    385     op = Cmd_Argv( 2 ); 
    386     v2 = Cvar_VariableIntegerValue( Cmd_Argv( 3 ) ); 
    387     vt = Cmd_Argv( 4 ); 
    388     if ( ( !strcmp( op, "="  ) && v1 == v2 ) || 
    389          ( !strcmp( op, "!=" ) && v1 != v2 ) || 
    390          ( !strcmp( op, "<"  ) && v1 <  v2 ) || 
    391          ( !strcmp( op, "<=" ) && v1 <= v2 ) || 
    392          ( !strcmp( op, ">"  ) && v1 >  v2 ) || 
    393          ( !strcmp( op, ">=" ) && v1 >= v2 ) ) 
    394     { 
    395       v = vt; 
    396       Com_Printf(va("then\n")); 
    397     } 
    398     else if ( ( !strcmp( op, "="  ) && v1 != v2 ) || 
    399               ( !strcmp( op, "!=" ) && v1 == v2 ) || 
    400               ( !strcmp( op, "<"  ) && v1 >= v2 ) || 
    401               ( !strcmp( op, "<=" ) && v1 >  v2 ) || 
    402               ( !strcmp( op, ">"  ) && v1 <= v2 ) || 
    403               ( !strcmp( op, ">=" ) && v1 <  v2 ) ) 
    404     { 
    405       if ( Cmd_Argc () == 6 )  
    406       { 
    407         vf = Cmd_Argv( 5 ); 
    408         v = vf; 
    409       } 
    410       else 
    411       { 
    412         return; 
    413       } 
    414     } 
    415     else 
    416     { 
    417       Com_Printf ("invalid operator in if command. valid operators are = != < > >= <=\n"); 
    418       return; 
    419     } 
    420   } 
    421   else { 
    422     Com_Printf ("if <variable1> <operator> <variable2> <variablethen> (<variableelse>) : compares the first two variables and executes <variablethen> if true, <variableelse> if false\n"); 
    423     return; 
    424   } 
    425   Cbuf_InsertText( va("%s\n", v ) ); 
    426 } 
    427  
    428 /* 
    429 =============== 
    430 Cmd_Math_f 
    431  
    432 Compares two cvars, if true vstr the third, if false vstr the forth 
    433 =============== 
    434 */ 
    435 void Cmd_Math_f( void ) { 
    436   char  *v; 
    437   char  *v1; 
    438   char  *v2; 
    439   char  *op; 
    440   if (Cmd_Argc () == 3) 
    441   { 
    442     v = Cmd_Argv( 1 ); 
    443     op = Cmd_Argv( 2 ); 
    444     if ( !strcmp( op, "++" ) ) 
    445     { 
    446       Cvar_SetValue( v, ( Cvar_VariableValue( v ) + 1 ) ); 
    447     } 
    448     else if ( !strcmp( op, "--" ) ) 
    449     { 
    450       Cvar_SetValue( v, ( Cvar_VariableValue( v ) - 1 ) ); 
    451     } 
    452     else 
    453     { 
    454       Com_Printf ("math <variableToSet> = <variable1> <operator> <variable2>\nmath <variableToSet> <operator> <variable1>\nmath <variableToSet> ++\nmath <variableToSet> --\nvalid operators are + - * / \n"); 
    455       return; 
    456     } 
    457   } 
    458   else if (Cmd_Argc () == 4) 
    459   { 
    460     v = Cmd_Argv( 1 ); 
    461     op = Cmd_Argv( 2 ); 
    462     v1 = Cmd_Argv( 3 ); 
    463     if ( !strcmp( op, "+" ) ) 
    464     { 
    465       Cvar_SetValue( v, ( Cvar_VariableValue( v ) + Cvar_VariableValue( v1 ) ) ); 
    466     } 
    467     else if ( !strcmp( op, "-" ) ) 
    468     { 
    469       Cvar_SetValue( v, ( Cvar_VariableValue( v ) - Cvar_VariableValue( v1 ) ) ); 
    470     } 
    471     else if ( !strcmp( op, "*" ) ) 
    472     { 
    473       Cvar_SetValue( v, ( Cvar_VariableValue( v ) * Cvar_VariableValue( v1 ) ) ); 
    474     } 
    475     else if ( !strcmp( op, "/" ) ) 
    476     { 
    477       if ( ! ( Cvar_VariableValue( v1 ) == 0 ) ) 
    478       { 
    479         Cvar_SetValue( v, ( Cvar_VariableValue( v ) / Cvar_VariableValue( v1 ) ) ); 
    480       } 
    481     } 
    482     else 
    483     { 
    484       Com_Printf ("math <variableToSet> = <variable1> <operator> <variable2>\nmath <variableToSet> <operator> <variable1>\nmath <variableToSet> ++\nmath <variableToSet> --\nvalid operators are + - * / \n"); 
    485       return; 
    486     } 
    487   } 
    488   else if (Cmd_Argc () == 6) 
    489   { 
    490     v = Cmd_Argv( 1 ); 
    491     v1 = Cmd_Argv( 3 ); 
    492     op = Cmd_Argv( 4 ); 
    493     v2 = Cmd_Argv( 5 ); 
    494     if ( !strcmp( op, "+" ) ) 
    495     { 
    496       Cvar_SetValue( v, ( Cvar_VariableValue( v1 ) + Cvar_VariableValue( v2 ) ) ); 
    497     } 
    498     else if ( !strcmp( op, "-" ) ) 
    499     { 
    500       Cvar_SetValue( v, ( Cvar_VariableValue( v1 ) - Cvar_VariableValue( v2 ) ) ); 
    501     } 
    502     else if ( !strcmp( op, "*" ) ) 
    503     { 
    504       Cvar_SetValue( v, ( Cvar_VariableValue( v1 ) * Cvar_VariableValue( v2 ) ) ); 
    505     } 
    506     else if ( !strcmp( op, "/" ) ) 
    507     { 
    508       if ( ! ( Cvar_VariableValue( v2 ) == 0 ) ) 
    509       { 
    510         Cvar_SetValue( v, ( Cvar_VariableValue( v1 ) / Cvar_VariableValue( v2 ) ) ); 
    511       } 
    512     } 
    513     else 
    514     { 
    515       Com_Printf ("math <variableToSet> = <variable1> <operator> <variable2>\nmath <variableToSet> <operator> <variable1>\nmath <variableToSet> ++\nmath <variableToSet> --\nvalid operators are + - * / \n"); 
    516       return; 
    517     } 
    518   } 
    519   else { 
    520     Com_Printf ("math <variableToSet> = <variable1> <operator> <variable2>\nmath <variableToSet> <operator> <variable1>\nmath <variableToSet> ++\nmath <variableToSet> --\nvalid operators are + - * / \n"); 
    521     return; 
    522   } 
    523 } 
    524  
    525 /* 
    526 =============== 
    527 Cmd_Concat_f 
    528  
    529 concatenates two cvars together 
    530 =============== 
    531 */ 
    532 void Cmd_Concat_f( void ) { 
    533   char  *v; 
    534   char  *v1; 
    535   char  *v2; 
    536   char  vc[MAX_CVAR_VALUE_STRING]; 
    537   if (Cmd_Argc () != 4) { 
    538     Com_Printf ("concat <variableToSet> <variable1> <variable2> : concatenates variable1 and variable2 and sets the result to variableToSet\n"); 
    539     return; 
    540   } 
    541  
    542   v  = Cmd_Argv( 1 ); 
    543   v1 = Cvar_VariableString( Cmd_Argv( 2 ) ); 
    544   v2 = Cvar_VariableString( Cmd_Argv( 3 ) ); 
    545   Com_sprintf(vc, sizeof(vc),"%s%s",v1,v2); 
    546   Cvar_Set( v, vc ); 
    547 } 
    548  
    549 //  
     284 
    550285/* 
    551286=============== 
     
    562297                Com_Printf ("%s ",Cmd_Argv(i)); 
    563298        Com_Printf ("\n"); 
    564 } 
    565  
    566  
    567 /* 
    568 =============== 
    569 Cmd_Delay_f 
    570  
    571 Delays a comand 
    572 =============== 
    573 */ 
    574 void Cmd_Delay_f (void) 
    575 { 
    576         int i, delay, type; 
    577         char *raw_delay; 
    578         qboolean availiable_cmd = qfalse; 
    579          
    580         // Check if the call is valid 
    581         if(Cmd_Argc () < 2) 
    582         { 
    583                 Com_Printf ("delay <delay in milliseconds> <command> or delay <delay in frames>f <command>, excutes command after the delay"); 
    584                 return; 
    585         } 
    586          
    587         raw_delay = Cmd_Argv(1); 
    588         delay = atoi(raw_delay); 
    589          
    590         if(delay < 1) 
    591         { 
    592                 Com_Printf ("delay: the delay must be a positive integer"); 
    593                 return; 
    594         } 
    595          
    596         //search for an unused slot 
    597         for(i=0; (i<MAX_DELAYED_COMMANDS); i++) 
    598         { 
    599                 if(delayed_cmd[i].delay == CMD_DELAY_UNUSED) 
    600                 { 
    601                         availiable_cmd = qtrue; 
    602                         break; 
    603                 } 
    604         } 
    605          
    606         if(!availiable_cmd) 
    607         { 
    608                 Com_Printf ("WARNING: Maximum amount of delayed commands reached."); 
    609                 return; 
    610         } 
    611  
    612         int lastchar = strlen( raw_delay ) - 1; 
    613          
    614         if(raw_delay[ lastchar ] == 'f' ) 
    615         { 
    616                 delay += CMD_DELAY_FRAME_FIRE; 
    617                 type = CMD_DELAY_FRAME; 
    618         }else{ 
    619                 type = CMD_DELAY_MSEC; 
    620                 delay += Sys_Milliseconds(); 
    621         } 
    622          
    623         delayed_cmd[i].delay = delay; 
    624         delayed_cmd[i].type = type; 
    625         Q_strncpyz(delayed_cmd[i].text, Cmd_ArgsFrom(2), MAX_CMD_LINE); 
    626299} 
    627300 
     
    805478// NOTE TTimo define that to track tokenization issues 
    806479//#define TKN_DBG 
    807 static void Cmd_TokenizeString2( const char *text_in, qboolean ignoreQuotes, qboolean parseCvar ) { 
    808         char    *text; 
     480static void Cmd_TokenizeString2( const char *text_in, qboolean ignoreQuotes ) { 
     481        const char      *text; 
    809482        char    *textOut; 
    810         const char *cvarName; 
    811         char buffer[ BIG_INFO_STRING ]; 
    812483 
    813484#ifdef TKN_DBG 
     
    824495        } 
    825496         
    826         // parse for cvar substitution 
    827         if ( parseCvar ) 
    828         { 
    829                 Q_strncpyz( buffer, text_in, sizeof( buffer ) ); 
    830                 text = buffer; 
    831                 textOut = cmd.cmd; 
    832                 while ( *text ) 
    833                 { 
    834                         if ( text[0] != '\'' || text[1] != '#' ) 
    835                         { 
    836                                 if ( textOut == sizeof(cmd.cmd) + cmd.cmd - 1 ) 
    837                                         break; 
    838                                 *textOut++ = *text++; 
    839                                 continue; 
    840                         } 
    841                         text += 2; 
    842                         cvarName = text; 
    843                         while ( *text && *text != '\'' ) 
    844                                 text++; 
    845                         if ( *text == '\'' ) 
    846                         { 
    847                                 *text = 0; 
    848                                 if ( Cvar_Flags( cvarName ) != CVAR_NONEXISTENT ) 
    849                                 { 
    850                                         Q_strncpyz( textOut, Cvar_VariableString( cvarName ), sizeof(cmd.cmd) - ( textOut - cmd.cmd ) ); 
    851                                         while ( *textOut ) 
    852                                                 textOut++; 
    853                                         if ( textOut == sizeof(cmd.cmd) + cmd.cmd - 1 ) 
    854                                                 break; 
    855                                 } 
    856                                 else 
    857                                 { 
    858                                         cvarName -= 2; 
    859                                         while ( *cvarName++ && textOut < sizeof(cmd.cmd) + cmd.cmd - 1 ) 
    860                                                 *textOut++ = *cvarName; 
    861                                         if ( textOut == sizeof(cmd.cmd) + cmd.cmd - 1 ) 
    862                                                 break; 
    863                                         *textOut++ = '\''; 
    864                                 } 
    865                                 text++; 
    866                         } 
    867                         else 
    868                         { 
    869                                 cvarName -= 2; 
    870                                 while ( *cvarName && textOut < sizeof(cmd.cmd) + cmd.cmd - 1 ) 
    871                                         *textOut++ = *cvarName++; 
    872                                 if ( textOut == sizeof(cmd.cmd) + cmd.cmd - 1 ) 
    873                                         break; 
    874                         } 
    875                 } 
    876                 *textOut = 0; 
    877         } 
    878         else 
    879                 Q_strncpyz( cmd.cmd, text_in, sizeof(cmd.cmd) ); 
    880  
    881         text = cmd.cmd; 
     497        Q_strncpyz( cmd.cmd, text_in, sizeof(cmd.cmd) ); 
     498 
     499        text = text_in; 
    882500        textOut = cmd.tokenized; 
    883501 
     
    969587*/ 
    970588void Cmd_TokenizeString( const char *text_in ) { 
    971         Cmd_TokenizeString2( text_in, qfalse, qfalse ); 
     589        Cmd_TokenizeString2( text_in, qfalse ); 
    972590} 
    973591 
     
    978596*/ 
    979597void Cmd_TokenizeStringIgnoreQuotes( const char *text_in ) { 
    980         Cmd_TokenizeString2( text_in, qtrue, qfalse ); 
    981 } 
    982  
    983 /* 
    984 ============ 
    985 Cmd_TokenizeStringParseCvar 
    986 ============ 
    987 */ 
    988 void Cmd_TokenizeStringParseCvar( const char *text_in ) { 
    989         Cmd_TokenizeString2( text_in, qfalse, qtrue ); 
     598        Cmd_TokenizeString2( text_in, qtrue ); 
    990599} 
    991600 
     
    1070679 
    1071680        // execute the command line 
    1072         Cmd_TokenizeStringParseCvar( text );             
     681        Cmd_TokenizeString( text );              
    1073682        if ( !Cmd_Argc() ) { 
    1074683                return;         // no tokens 
     
    1157766        Cmd_AddCommand ("exec",Cmd_Exec_f); 
    1158767        Cmd_AddCommand ("vstr",Cmd_Vstr_f); 
    1159         Cmd_AddCommand ("if",Cmd_If_f); 
    1160         Cmd_AddCommand ("concat",Cmd_Concat_f); 
    1161         Cmd_AddCommand ("math",Cmd_Math_f); 
    1162768        Cmd_AddCommand ("echo",Cmd_Echo_f); 
    1163769        Cmd_AddCommand ("wait", Cmd_Wait_f); 
    1164         Cmd_AddCommand ("delay", Cmd_Delay_f); 
    1165 } 
    1166  
     770} 
     771 
  • src/qcommon/common.c

    r62 r1  
    23722372*/ 
    23732373void Com_Init( char *commandLine ) { 
     2374        char    *s; 
    23742375 
    23752376        Com_Printf( "%s %s %s\n", Q3_VERSION, PLATFORM_STRING, __DATE__ ); 
     
    24782479        Cmd_AddCommand ("writeconfig", Com_WriteConfig_f ); 
    24792480 
    2480         com_version = Cvar_Get ("version", FULL_VERSION, CVAR_ROM | CVAR_SERVERINFO ); 
     2481        s = va("%s %s %s", Q3_VERSION, PLATFORM_STRING, __DATE__ ); 
     2482        com_version = Cvar_Get ("version", s, CVAR_ROM | CVAR_SERVERINFO ); 
    24812483 
    24822484        Sys_Init(); 
     
    26942696        } while ( msec < minMsec ); 
    26952697        Cbuf_Execute (); 
    2696         Cdelay_Frame (); 
    26972698 
    26982699        if (com_altivec->modified) 
  • src/qcommon/files.c

    r40 r0  
    9898e.g. the qpath "sound/newstuff/test.wav" would be searched for in the following places: 
    9999 
     100home path + current game's zip files 
    100101home path + current game's directory 
    101 home path + current game's zip files 
     102base path + current game's zip files 
    102103base path + current game's directory 
    103 base path + current game's zip files 
     104cd path + current game's zip files 
    104105cd path + current game's directory 
    105 cd path + current game's zip files 
    106  
     106 
     107home path + base game's zip file 
    107108home path + base game's directory 
    108 home path + base game's zip file 
     109base path + base game's zip file 
    109110base path + base game's directory 
    110 base path + base game's zip file 
     111cd path + base game's zip file 
    111112cd path + base game's directory 
    112 cd path + base game's zip file 
    113  
     113 
     114home path + BASEGAME's zip file 
    114115home path + BASEGAME's directory 
    115 home path + BASEGAME's zip file 
     116base path + BASEGAME's zip file 
    116117base path + BASEGAME's directory 
    117 base path + BASEGAME's zip file 
     118cd path + BASEGAME's zip file 
    118119cd path + BASEGAME's directory 
    119 cd path + BASEGAME's zip file 
    120120 
    121121server download, to be written to home path + current game's directory 
     
    24052405        Q_strncpyz( fs_gamedir, dir, sizeof( fs_gamedir ) ); 
    24062406 
     2407        // 
     2408        // add the directory to the search path 
     2409        // 
     2410        search = Z_Malloc (sizeof(searchpath_t)); 
     2411        search->dir = Z_Malloc( sizeof( *search->dir ) ); 
     2412 
     2413        Q_strncpyz( search->dir->path, path, sizeof( search->dir->path ) ); 
     2414        Q_strncpyz( search->dir->gamedir, dir, sizeof( search->dir->gamedir ) ); 
     2415        search->next = fs_searchpaths; 
     2416        fs_searchpaths = search; 
     2417 
    24072418        // find all pak files in this directory 
    24082419        pakfile = FS_BuildOSPath( path, dir, "" ); 
     
    24252436                fs_searchpaths = search; 
    24262437        } 
    2427  
    2428         // 
    2429         // add the directory to the search path 
    2430         // 
    2431         search = Z_Malloc (sizeof(searchpath_t)); 
    2432         search->dir = Z_Malloc( sizeof( *search->dir ) ); 
    2433  
    2434         Q_strncpyz( search->dir->path, path, sizeof( search->dir->path ) ); 
    2435         Q_strncpyz( search->dir->gamedir, dir, sizeof( search->dir->gamedir ) ); 
    2436         search->next = fs_searchpaths; 
    2437         fs_searchpaths = search; 
    24382438 
    24392439        // done 
  • src/qcommon/q_shared.h

    r122 r1  
    2929 
    3030#define PRODUCT_NAME            "tremulous" 
    31  
    32 #ifndef PRODUCT_VERSION 
    33 #define PRODUCT_VERSION         "DnC-Eggy" 
    34 #endif 
     31#define PRODUCT_VERSION         "1.1.0" 
    3532 
    3633#ifdef SVN_VERSION 
     
    4239#define CLIENT_WINDOW_TITLE       "Tremulous " PRODUCT_VERSION 
    4340#define CLIENT_WINDOW_MIN_TITLE   "Tremulous" 
    44  
    45 #define FULL_VERSION Q3_VERSION " " PLATFORM_STRING " " __DATE__ 
    4641 
    4742#define MAX_TEAMNAME 32 
     
    13231318#define MAX_SERVERSTATUSREQUESTS        16 
    13241319 
    1325 #define SAY_ALL               0 
    1326 #define SAY_TEAM              1 
    1327 #define SAY_TELL              2 
    1328 #define SAY_ACTION      3 
    1329 #define SAY_ACTION_T    4 
    1330 #define SAY_ADMINS      5 
     1320#define SAY_ALL         0 
     1321#define SAY_TEAM        1 
     1322#define SAY_TELL        2 
    13311323 
    13321324#endif  // __Q_SHARED_H 
  • src/qcommon/qcommon.h

    r62 r1  
    365365// Do not call inside a command function, or current args will be destroyed. 
    366366 
    367 void Cdelay_Frame (void); 
    368 //Check if a delayed command have to be executed and decreases the remaining 
    369 //delay time for all of them 
    370  
    371367//=========================================================================== 
    372368 
     
    408404void    Cmd_TokenizeString( const char *text ); 
    409405void    Cmd_TokenizeStringIgnoreQuotes( const char *text_in ); 
    410 void    Cmd_TokenizeStringParseCvar( const char *text_in ); 
    411406// Takes a null terminated string.  Does not need to be /n terminated. 
    412407// breaks the string up into arg tokens. 
  • src/server/sv_ccmds.c

    r54 r1  
    292292 
    293293                // add the map_restart command 
    294                 SV_AddServerCommand( client, "restartmap\n" ); 
     294                SV_AddServerCommand( client, "map_restart\n" ); 
    295295 
    296296                // connect the client again, without the firstTime flag 
     
    732732        Cmd_AddCommand ("systeminfo", SV_Systeminfo_f); 
    733733        Cmd_AddCommand ("dumpuser", SV_DumpUser_f); 
    734         Cmd_AddCommand ("restartmap", SV_MapRestart_f); 
     734        Cmd_AddCommand ("map_restart", SV_MapRestart_f); 
    735735        Cmd_AddCommand ("sectorlist", SV_SectorList_f); 
    736736        Cmd_AddCommand ("map", SV_Map_f); 
     
    758758        Cmd_RemoveCommand ("systeminfo"); 
    759759        Cmd_RemoveCommand ("dumpuser"); 
    760         Cmd_RemoveCommand ("restartmap"); 
     760        Cmd_RemoveCommand ("map_restart"); 
    761761        Cmd_RemoveCommand ("sectorlist"); 
    762762        Cmd_RemoveCommand ("say"); 
  • src/server/sv_client.c

    r37 r0  
    170170                svs.challenges[i].connected = qtrue; 
    171171 
    172                 // allow admins to override ping restrictions 
    173172                // never reject a LAN client based on ping 
    174                 if ( !Sys_IsLANAddress( from ) && VM_Call( gvm, GAME_PING_OVERRIDE ) != 1 ) 
    175                 { 
    176                         if ( sv_minPing->value && ping < sv_minPing->value ) 
    177                         { 
     173                if ( !Sys_IsLANAddress( from ) ) { 
     174                        if ( sv_minPing->value && ping < sv_minPing->value ) { 
    178175                                // don't let them keep trying until they get a big delay 
    179176                                NET_OutOfBandPrint( NS_SERVER, from, "print\nServer is for high pings only" ); 
     
    184181                                return; 
    185182                        } 
    186                         if ( sv_maxPing->value && ping > sv_maxPing->value ) 
    187                         { 
     183                        if ( sv_maxPing->value && ping > sv_maxPing->value ) { 
    188184                                NET_OutOfBandPrint( NS_SERVER, from, "print\nServer is for low pings only" ); 
    189185                                Com_DPrintf ("Client %i rejected on a too high ping\n", i); 
  • src/server/sv_main.c

    r54 r1  
    295295void SV_MasterGameStat( const char *data ) 
    296296{ 
    297   static netadr_t adr[MAX_MASTER_SERVERS]; 
    298   int     i; 
     297        static netadr_t adr; 
    299298 
    300299        if( !com_dedicated || com_dedicated->integer != 2 ) 
    301300                return;         // only dedicated servers send stats 
    302301 
    303   // send to group masters 
    304   for ( i = 0 ; i < MAX_MASTER_SERVERS ; i++ ) { 
    305     if ( !sv_master[i]->string[0] ) { 
    306       continue; 
    307     } 
    308  
    309     // see if we haven't already resolved the name 
    310     // resolving usually causes hitches on win95, so only 
    311     // do it when needed 
    312     if ( sv_master[i]->modified ) { 
    313       sv_master[i]->modified = qfalse; 
    314    
    315       Com_Printf( "Resolving %s\n", sv_master[i]->string ); 
    316       if ( !NET_StringToAdr( sv_master[i]->string, &adr[i] ) ) { 
    317         Com_Printf( "Couldn't resolve address: %s\n", sv_master[i]->string ); 
    318         continue; 
    319       } 
    320       if ( !strchr( sv_master[i]->string, ':' ) ) { 
    321         adr[i].port = BigShort( PORT_MASTER ); 
    322       } 
    323       Com_Printf( "%s resolved to %i.%i.%i.%i:%i\n", sv_master[i]->string, 
    324                   adr[i].ip[0], adr[i].ip[1], adr[i].ip[2], adr[i].ip[3], 
    325                   BigShort( adr[i].port ) ); 
    326     } 
    327  
    328  
    329     Com_Printf ("Sending gamestat to %s\n", sv_master[i]->string ); 
    330     // this command should be changed if the server info / status format 
    331     // ever incompatably changes 
    332     NET_OutOfBandPrint( NS_SERVER, adr[i], "gamestat %s\n", data ); 
     302  Com_Printf( "Resolving %s\n", MASTER_SERVER_NAME ); 
     303  if( !NET_StringToAdr( MASTER_SERVER_NAME, &adr ) ) 
     304  { 
     305    Com_Printf( "Couldn't resolve address: %s\n", MASTER_SERVER_NAME ); 
     306    return; 
    333307  } 
     308  else 
     309  { 
     310    if( !strstr( ":", MASTER_SERVER_NAME ) ) 
     311      adr.port = BigShort( PORT_MASTER ); 
     312 
     313    Com_Printf( "%s resolved to %i.%i.%i.%i:%i\n", MASTER_SERVER_NAME, 
     314      adr.ip[0], adr.ip[1], adr.ip[2], adr.ip[3], 
     315      BigShort( adr.port ) ); 
     316  } 
     317 
     318  Com_Printf ("Sending gamestat to %s\n", MASTER_SERVER_NAME ); 
     319  NET_OutOfBandPrint( NS_SERVER, adr, "gamestat %s", data ); 
    334320} 
    335321 
     
    852838        if( sv.restartTime && sv.time >= sv.restartTime ) { 
    853839                sv.restartTime = 0; 
    854                 Cbuf_AddText( "restartmap 0\n" ); 
     840                Cbuf_AddText( "map_restart 0\n" ); 
    855841                return; 
    856842        } 
  • src/ui/ui_local.h

    r118 r0  
    128128extern vmCvar_t  ui_smallFont; 
    129129extern vmCvar_t  ui_bigFont; 
    130 extern vmCvar_t  ui_serverStatusTimeOut; 
    131  
     130extern vmCvar_t ui_serverStatusTimeOut; 
     131 
     132//TA: bank values 
     133extern vmCvar_t  ui_bank; 
    132134 
    133135 
     
    745747} modInfo_t; 
    746748 
     749//TA: tremulous menus 
     750#define MAX_INFOPANE_TEXT     4096 
     751#define MAX_INFOPANE_GRAPHICS 16 
     752#define MAX_INFOPANES         128 
     753 
    747754typedef enum 
    748755{ 
    749   INFOTYPE_TEXT, 
    750   INFOTYPE_BUILDABLE, 
    751   INFOTYPE_CLASS, 
    752   INFOTYPE_WEAPON, 
    753   INFOTYPE_UPGRADE 
    754 } infoType_t; 
     756  INFOPANE_TOP, 
     757  INFOPANE_BOTTOM, 
     758  INFOPANE_LEFT, 
     759  INFOPANE_RIGHT 
     760} tremIPSide_t; 
    755761 
    756762typedef struct 
    757763{ 
    758   const char    *text; 
    759   const char    *cmd; 
    760   infoType_t    type; 
    761   union 
    762   { 
    763     const char  *text; 
    764     buildable_t buildable; 
    765     pClass_t    pclass; 
    766     weapon_t    weapon; 
    767     upgrade_t   upgrade; 
    768   } v; 
    769 } menuItem_t; 
     764  qhandle_t     graphic; 
     765 
     766  tremIPSide_t  side; 
     767  int           offset; 
     768 
     769  int           width, height; 
     770} tremIPGraphic_t; 
     771 
     772typedef struct 
     773{ 
     774  const char      *name; 
     775  char            text[ MAX_INFOPANE_TEXT ]; 
     776  int             align; 
     777 
     778  tremIPGraphic_t graphics[ MAX_INFOPANE_GRAPHICS ]; 
     779  int             numGraphics; 
     780} tremInfoPane_t; 
     781 
     782typedef struct 
     783{ 
     784  const char      *text; 
     785  const char      *cmd; 
     786  tremInfoPane_t  *infopane; 
     787} tremMenuItem_t; 
     788//TA: tremulous menus 
    770789 
    771790typedef struct { 
     
    834853  int previewMovie; 
    835854 
    836   menuItem_t  tremTeamList[ 4 ]; 
    837   int         tremTeamCount; 
    838   int         tremTeamIndex; 
    839  
    840   menuItem_t  alienClassList[ 3 ]; 
    841   int         alienClassCount; 
    842   int         alienClassIndex; 
    843  
    844   menuItem_t  humanItemList[ 3 ]; 
    845   int         humanItemCount; 
    846   int         humanItemIndex; 
    847  
    848   menuItem_t  humanArmouryBuyList[ 32 ]; 
    849   int         humanArmouryBuyCount; 
    850   int         humanArmouryBuyIndex; 
    851  
    852   menuItem_t  humanArmourySellList[ 32 ]; 
    853   int         humanArmourySellCount; 
    854   int         humanArmourySellIndex; 
    855  
    856   menuItem_t  alienUpgradeList[ 16 ]; 
    857   int         alienUpgradeCount; 
    858   int         alienUpgradeIndex; 
    859  
    860   menuItem_t  alienBuildList[ 32 ]; 
    861   int         alienBuildCount; 
    862   int         alienBuildIndex; 
    863  
    864   menuItem_t  humanBuildList[ 32 ]; 
    865   int         humanBuildCount; 
    866   int         humanBuildIndex; 
     855  tremInfoPane_t  tremInfoPanes[ MAX_INFOPANES ]; 
     856  int             tremInfoPaneCount; 
     857 
     858//TA: tremulous menus 
     859  tremMenuItem_t  tremTeamList[ 4 ]; 
     860  int             tremTeamCount; 
     861  int             tremTeamIndex; 
     862 
     863  tremMenuItem_t  tremAlienClassList[ 3 ]; 
     864  int             tremAlienClassCount; 
     865  int             tremAlienClassIndex; 
     866 
     867  tremMenuItem_t  tremHumanItemList[ 3 ]; 
     868  int             tremHumanItemCount; 
     869  int             tremHumanItemIndex; 
     870 
     871  tremMenuItem_t  tremHumanArmouryBuyList[ 32 ]; 
     872  int             tremHumanArmouryBuyCount; 
     873  int             tremHumanArmouryBuyIndex; 
     874 
     875  tremMenuItem_t  tremHumanArmourySellList[ 32 ]; 
     876  int             tremHumanArmourySellCount; 
     877  int             tremHumanArmourySellIndex; 
     878 
     879  tremMenuItem_t  tremAlienUpgradeList[ 16 ]; 
     880  int             tremAlienUpgradeCount; 
     881  int             tremAlienUpgradeIndex; 
     882 
     883  tremMenuItem_t  tremAlienBuildList[ 32 ]; 
     884  int             tremAlienBuildCount; 
     885  int             tremAlienBuildIndex; 
     886 
     887  tremMenuItem_t  tremHumanBuildList[ 32 ]; 
     888  int             tremHumanBuildCount; 
     889  int             tremHumanBuildIndex; 
     890//TA: tremulous menus 
    867891 
    868892  serverStatus_t serverStatus; 
  • src/ui/ui_main.c

    r122 r1  
    291291  glyphInfo_t *glyph; 
    292292  float useScale; 
    293   const char *s = text; 
     293  const char *s = text; // bk001206 - unsigned 
    294294  fontInfo_t *font = &uiInfo.uiDC.Assets.textFont; 
    295295  if (scale <= ui_smallFont.value) { 
     
    344344  useScale = scale * font->glyphScale; 
    345345  if (text) { 
    346     const char *s = text; 
     346    const char *s = text; // bk001206 - unsigned 
    347347    trap_R_SetColor( color ); 
    348348    memcpy(&newColor[0], &color[0], sizeof(vec4_t)); 
     
    470470  useScale = scale * font->glyphScale; 
    471471  if (text) { 
    472     const char *s = text; 
     472    const char *s = text; // bk001206 - unsigned 
    473473    trap_R_SetColor( color ); 
    474474    memcpy(&newColor[0], &color[0], sizeof(vec4_t)); 
     
    478478    } 
    479479    count = 0; 
    480     glyph2 = &font->glyphs[ (int) cursor]; 
     480    glyph2 = &font->glyphs[ (int) cursor]; // bk001206 - possible signed char 
    481481    while (s && *s && count < len) { 
    482482      glyph = &font->glyphs[(int)*s]; 
     
    617617  glyphInfo_t *glyph; 
    618618  if (text) { 
    619     const char *s = text; 
     619    const char *s = text; // bk001206 - unsigned 
    620620    float max = *maxX; 
    621621    float useScale; 
     
    737737  UI_SetColor( NULL ); 
    738738 
    739   // don't draw the cursor whilst loading 
     739  //TA: don't draw the cursor whilst loading 
    740740  if( Menu_Count( ) > 0 && !trap_Cvar_VariableValue( "ui_loading" ) ) 
    741741    UI_DrawHandlePic( uiInfo.uiDC.cursorx-16, uiInfo.uiDC.cursory-16, 32, 32, uiInfo.uiDC.Assets.cursor); 
     
    998998  } 
    999999  trap_Parse_FreeSource(handle); 
     1000} 
     1001 
     1002/* 
     1003=============== 
     1004UI_FindInfoPaneByName 
     1005=============== 
     1006*/ 
     1007tremInfoPane_t *UI_FindInfoPaneByName( const char *name ) 
     1008{ 
     1009  int i; 
     1010 
     1011  for( i = 0; i < uiInfo.tremInfoPaneCount; i++ ) 
     1012  { 
     1013    if( !Q_stricmp( uiInfo.tremInfoPanes[ i ].name, name ) ) 
     1014      return &uiInfo.tremInfoPanes[ i ]; 
     1015  } 
     1016 
     1017  //create a dummy infopane demanding the user write the infopane 
     1018  uiInfo.tremInfoPanes[ i ].name = String_Alloc( name ); 
     1019  strncpy( uiInfo.tremInfoPanes[ i ].text, "Not implemented.\n\nui/infopanes.def\n", MAX_INFOPANE_TEXT ); 
     1020  Q_strcat( uiInfo.tremInfoPanes[ i ].text, MAX_INFOPANE_TEXT, String_Alloc( name ) ); 
     1021 
     1022  uiInfo.tremInfoPaneCount++; 
     1023 
     1024  return &uiInfo.tremInfoPanes[ i ]; 
     1025} 
     1026 
     1027/* 
     1028=============== 
     1029UI_LoadInfoPane 
     1030=============== 
     1031*/ 
     1032qboolean UI_LoadInfoPane( int handle ) 
     1033{ 
     1034  pc_token_t  token; 
     1035  qboolean    valid = qfalse; 
     1036 
     1037  while( 1 ) 
     1038  { 
     1039    memset( &token, 0, sizeof( pc_token_t ) ); 
     1040 
     1041    if( !trap_Parse_ReadToken( handle, &token ) ) 
     1042      break; 
     1043 
     1044    if( !Q_stricmp( token.string, "name" ) ) 
     1045    { 
     1046      memset( &token, 0, sizeof( pc_token_t ) ); 
     1047 
     1048      if( !trap_Parse_ReadToken( handle, &token ) ) 
     1049        break; 
     1050 
     1051      uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].name = String_Alloc( token.string ); 
     1052      valid = qtrue; 
     1053    } 
     1054    else if( !Q_stricmp( token.string, "graphic" ) ) 
     1055    { 
     1056      int *graphic; 
     1057 
     1058      memset( &token, 0, sizeof( pc_token_t ) ); 
     1059 
     1060      if( !trap_Parse_ReadToken( handle, &token ) ) 
     1061        break; 
     1062 
     1063      graphic = &uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].numGraphics; 
     1064 
     1065      if( !Q_stricmp( token.string, "top" ) ) 
     1066        uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].graphics[ *graphic ].side = INFOPANE_TOP; 
     1067      else if( !Q_stricmp( token.string, "bottom" ) ) 
     1068        uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].graphics[ *graphic ].side = INFOPANE_BOTTOM; 
     1069      else if( !Q_stricmp( token.string, "left" ) ) 
     1070        uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].graphics[ *graphic ].side = INFOPANE_LEFT; 
     1071      else if( !Q_stricmp( token.string, "right" ) ) 
     1072        uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].graphics[ *graphic ].side = INFOPANE_RIGHT; 
     1073      else 
     1074        break; 
     1075 
     1076      memset( &token, 0, sizeof( pc_token_t ) ); 
     1077 
     1078      if( !trap_Parse_ReadToken( handle, &token ) ) 
     1079        break; 
     1080 
     1081      if( !Q_stricmp( token.string, "center" ) ) 
     1082        uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].graphics[ *graphic ].offset = -1; 
     1083      else 
     1084        uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].graphics[ *graphic ].offset = token.intvalue; 
     1085 
     1086      memset( &token, 0, sizeof( pc_token_t ) ); 
     1087 
     1088      if( !trap_Parse_ReadToken( handle, &token ) ) 
     1089        break; 
     1090 
     1091      uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].graphics[ *graphic ].graphic = 
     1092        trap_R_RegisterShaderNoMip( token.string ); 
     1093 
     1094      memset( &token, 0, sizeof( pc_token_t ) ); 
     1095 
     1096      if( !trap_Parse_ReadToken( handle, &token ) ) 
     1097        break; 
     1098 
     1099      uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].graphics[ *graphic ].width = token.intvalue; 
     1100 
     1101      memset( &token, 0, sizeof( pc_token_t ) ); 
     1102 
     1103      if( !trap_Parse_ReadToken( handle, &token ) ) 
     1104        break; 
     1105 
     1106      uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].graphics[ *graphic ].height = token.intvalue; 
     1107 
     1108      //increment graphics 
     1109      (*graphic)++; 
     1110 
     1111      if( *graphic == MAX_INFOPANE_GRAPHICS ) 
     1112        break; 
     1113    } 
     1114    else if( !Q_stricmp( token.string, "text" ) ) 
     1115    { 
     1116      memset( &token, 0, sizeof( pc_token_t ) ); 
     1117 
     1118      if( !trap_Parse_ReadToken( handle, &token ) ) 
     1119        break; 
     1120 
     1121      Q_strcat( uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].text, MAX_INFOPANE_TEXT, token.string ); 
     1122    } 
     1123    else if( !Q_stricmp( token.string, "align" ) ) 
     1124    { 
     1125      memset( &token, 0, sizeof( pc_token_t ) ); 
     1126 
     1127      if( !trap_Parse_ReadToken( handle, &token ) ) 
     1128        break; 
     1129 
     1130      if( !Q_stricmp( token.string, "left" ) ) 
     1131        uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].align = ITEM_ALIGN_LEFT; 
     1132      else if( !Q_stricmp( token.string, "right" ) ) 
     1133        uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].align = ITEM_ALIGN_RIGHT; 
     1134      else if( !Q_stricmp( token.string, "center" ) ) 
     1135        uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].align = ITEM_ALIGN_CENTER; 
     1136    } 
     1137    else if( token.string[ 0 ] == '}' ) 
     1138    { 
     1139      //reached the end, break 
     1140      break; 
     1141    } 
     1142    else 
     1143      break; 
     1144  } 
     1145 
     1146  if( valid ) 
     1147  { 
     1148    uiInfo.tremInfoPaneCount++; 
     1149    return qtrue; 
     1150  } 
     1151  else 
     1152  { 
     1153    return qfalse; 
     1154  } 
     1155} 
     1156 
     1157/* 
     1158=============== 
     1159UI_LoadInfoPanes 
     1160=============== 
     1161*/ 
     1162void UI_LoadInfoPanes( const char *file ) 
     1163{ 
     1164  pc_token_t token; 
     1165  int handle; 
     1166  int count; 
     1167 
     1168  uiInfo.tremInfoPaneCount = count = 0; 
     1169 
     1170  handle = trap_Parse_LoadSource( file ); 
     1171 
     1172  if( !handle ) 
     1173  { 
     1174    trap_Error( va( S_COLOR_YELLOW "infopane file not found: %s\n", file ) ); 
     1175    return; 
     1176  } 
     1177 
     1178  while( 1 ) 
     1179  { 
     1180    if( !trap_Parse_ReadToken( handle, &token ) ) 
     1181      break; 
     1182 
     1183    if( token.string[ 0 ] == 0 ) 
     1184      break; 
     1185 
     1186    if( token.string[ 0 ] == '{' ) 
     1187    { 
     1188      if( UI_LoadInfoPane( handle ) ) 
     1189        count++; 
     1190 
     1191      if( count == MAX_INFOPANES ) 
     1192        break; 
     1193    } 
     1194  } 
     1195 
     1196  trap_Parse_FreeSource( handle ); 
    10001197} 
    10011198 
     
    12091406 
    12101407 
     1408#define GRAPHIC_BWIDTH  8.0f 
    12111409/* 
    12121410=============== 
     
    12141412=============== 
    12151413*/ 
    1216 static void UI_DrawInfoPane( menuItem_t *item, rectDef_t *rect, float text_x, float text_y, 
     1414static void UI_DrawInfoPane( tremInfoPane_t *pane, rectDef_t *rect, float text_x, float text_y, 
    12171415                             float scale, vec4_t color, int textStyle ) 
    12181416{ 
     1417  int       i; 
    12191418  float     maxLeft = 0, maxTop = 0; 
    12201419  float     maxRight = 0, maxBottom = 0; 
    12211420  float     x = rect->x - text_x, y = rect->y - text_y, w, h; 
     1421  float     xoffset = 0, yoffset = 0; 
    12221422  menuDef_t dummyParent; 
    12231423  itemDef_t textItem; 
    1224   int       value = 0; 
    1225   char      *string = ""; 
    1226   int       class, credits; 
    1227   char      ui_currentClass[ MAX_STRING_CHARS ]; 
    1228  
    1229   trap_Cvar_VariableStringBuffer( "ui_currentClass", ui_currentClass, MAX_STRING_CHARS ); 
    1230   sscanf( ui_currentClass, "%d %d", &class, &credits ); 
     1424 
     1425  //iterate through graphics 
     1426  for( i = 0; i < pane->numGraphics; i++ ) 
     1427  { 
     1428    float width         = pane->graphics[ i ].width; 
     1429    float height        = pane->graphics[ i ].height; 
     1430    qhandle_t graphic = pane->graphics[ i ].graphic; 
     1431 
     1432    if( pane->graphics[ i ].side == INFOPANE_TOP || pane->graphics[ i ].side == INFOPANE_BOTTOM ) 
     1433    { 
     1434      //set horizontal offset of graphic 
     1435      if( pane->graphics[ i ].offset < 0 ) 
     1436        xoffset = ( rect->w / 2 ) - ( pane->graphics[ i ].width / 2 ); 
     1437      else 
     1438        xoffset = pane->graphics[ i ].offset + GRAPHIC_BWIDTH; 
     1439    } 
     1440    else if( pane->graphics[ i ].side == INFOPANE_LEFT || pane->graphics[ i ].side == INFOPANE_RIGHT ) 
     1441    { 
     1442      //set vertical offset of graphic 
     1443      if( pane->graphics[ i ].offset < 0 ) 
     1444        yoffset = ( rect->h / 2 ) - ( pane->graphics[ i ].height / 2 ); 
     1445      else 
     1446        yoffset = pane->graphics[ i ].offset + GRAPHIC_BWIDTH; 
     1447    } 
     1448 
     1449    if( pane->graphics[ i ].side == INFOPANE_LEFT ) 
     1450    { 
     1451      //set the horizontal offset of the text 
     1452      if( pane->graphics[ i ].width > maxLeft ) 
     1453        maxLeft = pane->graphics[ i ].width + GRAPHIC_BWIDTH; 
     1454 
     1455      xoffset = GRAPHIC_BWIDTH; 
     1456    } 
     1457    else if( pane->graphics[ i ].side == INFOPANE_RIGHT ) 
     1458    { 
     1459      if( pane->graphics[ i ].width > maxRight ) 
     1460        maxRight = pane->graphics[ i ].width + GRAPHIC_BWIDTH; 
     1461 
     1462      xoffset = rect->w - width - GRAPHIC_BWIDTH; 
     1463    } 
     1464    else if( pane->graphics[ i ].side == INFOPANE_TOP ) 
     1465    { 
     1466      //set the vertical offset of the text 
     1467      if( pane->graphics[ i ].height > maxTop ) 
     1468        maxTop = pane->graphics[ i ].height + GRAPHIC_BWIDTH; 
     1469 
     1470      yoffset = GRAPHIC_BWIDTH; 
     1471    } 
     1472    else if( pane->graphics[ i ].side == INFOPANE_BOTTOM ) 
     1473    { 
     1474      if( pane->graphics[ i ].height > maxBottom ) 
     1475        maxBottom = pane->graphics[ i ].height + GRAPHIC_BWIDTH; 
     1476 
     1477      yoffset = rect->h - height - GRAPHIC_BWIDTH; 
     1478    } 
     1479 
     1480    //draw the graphic 
     1481    UI_DrawHandlePic( x + xoffset, y + yoffset, width, height, graphic ); 
     1482  } 
    12311483 
    12321484  //offset the text 
     
    12361488  h = rect->h - ( maxTop + maxBottom ); 
    12371489 
    1238   switch( item->type ) 
    1239   { 
    1240     case INFOTYPE_TEXT: 
    1241       textItem.text = item->v.text; 
    1242       break; 
    1243  
    1244     case INFOTYPE_CLASS: 
    1245       value = BG_ClassCanEvolveFromTo( class, item->v.pclass, credits, 0 ); 
    1246       if( value < 1 ) 
    1247       { 
    1248         textItem.text = va( "%s\n\n%s", 
    1249             BG_FindHumanNameForClassNum( item->v.pclass ), 
    1250             BG_FindInfoForClassNum( item->v.pclass ) ); 
    1251       } 
    1252       else 
    1253       { 
    1254         textItem.text = va( "%s\n\n%s\n\nKills: %d", 
    1255             BG_FindHumanNameForClassNum( item->v.pclass ), 
    1256             BG_FindInfoForClassNum( item->v.pclass ), 
    1257             value ); 
    1258       } 
    1259       break; 
    1260  
    1261     case INFOTYPE_WEAPON: 
    1262       value = BG_FindPriceForWeapon( item->v.weapon ); 
    1263       if( value == 0 ) 
    1264       { 
    1265         textItem.text = va( "%s\n\n%s\n\nCredits: Free", 
    1266             BG_FindHumanNameForWeapon( item->v.weapon ), 
    1267             BG_FindInfoForWeapon( item->v.weapon ) ); 
    1268       } 
    1269       else 
    1270       { 
    1271         textItem.text = va( "%s\n\n%s\n\nCredits: %d", 
    1272             BG_FindHumanNameForWeapon( item->v.weapon ), 
    1273             BG_FindInfoForWeapon( item->v.weapon ), 
    1274             value ); 
    1275       } 
    1276       break; 
    1277  
    1278     case INFOTYPE_UPGRADE: 
    1279       value = BG_FindPriceForUpgrade( item->v.upgrade ); 
    1280       if( value == 0 ) 
    1281       { 
    1282         textItem.text = va( "%s\n\n%s\n\nCredits: Free", 
    1283             BG_FindHumanNameForUpgrade( item->v.upgrade ), 
    1284             BG_FindInfoForUpgrade( item->v.upgrade ) ); 
    1285       } 
    1286       else 
    1287       { 
    1288         textItem.text = va( "%s\n\n%s\n\nCredits: %d", 
    1289             BG_FindHumanNameForUpgrade( item->v.upgrade ), 
    1290             BG_FindInfoForUpgrade( item->v.upgrade ), 
    1291             value ); 
    1292       } 
    1293       break; 
    1294  
    1295     case INFOTYPE_BUILDABLE: 
    1296       value = BG_FindBuildPointsForBuildable( item->v.buildable ); 
    1297       switch( BG_FindTeamForBuildable( item->v.buildable ) ) 
    1298       { 
    1299         case BIT_ALIENS: string = "Sentience"; break; 
    1300         case BIT_HUMANS: string = "Power"; break; 
    1301         default: break; 
    1302       } 
    1303  
    1304       if( value == 0 ) 
    1305       { 
    1306         textItem.text = va( "%s\n\n%s", 
    1307             BG_FindHumanNameForBuildable( item->v.buildable ), 
    1308             BG_FindInfoForBuildable( item->v.buildable ) ); 
    1309       } 
    1310       else 
    1311       { 
    1312         textItem.text = va( "%s\n\n%s\n\n%s: %d", 
    1313             BG_FindHumanNameForBuildable( item->v.buildable ), 
    1314             BG_FindInfoForBuildable( item->v.buildable ), 
    1315             string, value ); 
    1316       } 
    1317       break; 
    1318   } 
     1490  textItem.text = pane->text; 
    13191491 
    13201492  textItem.parent = &dummyParent; 
     
    13221494  textItem.window.flags = 0; 
    13231495 
    1324   textItem.window.rect.x = x; 
     1496  switch( pane->align ) 
     1497  { 
     1498    case ITEM_ALIGN_LEFT: 
     1499      textItem.window.rect.x = x; 
     1500      break; 
     1501 
     1502    case ITEM_ALIGN_RIGHT: 
     1503      textItem.window.rect.x = x + w; 
     1504      break; 
     1505 
     1506    case ITEM_ALIGN_CENTER: 
     1507      textItem.window.rect.x = x + ( w / 2 ); 
     1508      break; 
     1509 
     1510    default: 
     1511      textItem.window.rect.x = x; 
     1512      break; 
     1513  } 
     1514 
    13251515  textItem.window.rect.y = y; 
    13261516  textItem.window.rect.w = w; 
     
    13311521  textItem.textRect.w = 0; 
    13321522  textItem.textRect.h = 0; 
    1333   textItem.textalignment = ITEM_ALIGN_LEFT; 
     1523  textItem.textalignment = pane->align; 
    13341524  textItem.textalignx = text_x; 
    13351525  textItem.textaligny = text_y; 
     
    20962286 
    20972287static void UI_DrawKeyBindStatus(rectDef_t *rect, float scale, vec4_t color, int textStyle) { 
     2288//  int ofs = 0; TTimo: unused 
    20982289  if (Display_KeyBindPending()) { 
    20992290    Text_Paint(rect->x, rect->y, scale, color, "Waiting for new key... Press ESCAPE to cancel", 0, 0, textStyle); 
     
    21142305 
    21152306  // build null terminated extension strings 
     2307  // TTimo: https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=399 
    21162308  // in TA this was not directly crashing, but displaying a nasty broken shader right in the middle 
    21172309  // brought down the string size to 1024, there's not much that can be shown on the screen anyway 
     
    21572349{ 
    21582350  rectDef_t       rect; 
     2351  tremInfoPane_t  *pane = NULL; 
    21592352 
    21602353  rect.x = x + text_x; 
     
    21662359  { 
    21672360    case UI_TEAMINFOPANE: 
    2168         UI_DrawInfoPane( &uiInfo.tremTeamList[ uiInfo.tremTeamIndex ], 
    2169           &rect, text_x, text_y, scale, color, textStyle ); 
     2361      if( ( pane = uiInfo.tremTeamList[ uiInfo.tremTeamIndex ].infopane ) ) 
     2362        UI_DrawInfoPane( pane, &rect, text_x, text_y, scale, color, textStyle ); 
    21702363      break; 
    21712364 
    21722365    case UI_ACLASSINFOPANE: 
    2173         UI_DrawInfoPane( &uiInfo.alienClassList[ uiInfo.alienClassIndex ], 
    2174           &rect, text_x, text_y, scale, color, textStyle ); 
     2366      if( ( pane = uiInfo.tremAlienClassList[ uiInfo.tremAlienClassIndex ].infopane ) ) 
     2367        UI_DrawInfoPane( pane, &rect, text_x, text_y, scale, color, textStyle ); 
    21752368      break; 
    21762369 
    21772370    case UI_AUPGRADEINFOPANE: 
    2178         UI_DrawInfoPane( &uiInfo.alienUpgradeList[ uiInfo.alienUpgradeIndex ], 
    2179           &rect, text_x, text_y, scale, color, textStyle ); 
     2371      if( ( pane = uiInfo.tremAlienUpgradeList[ uiInfo.tremAlienUpgradeIndex ].infopane ) ) 
     2372        UI_DrawInfoPane( pane, &rect, text_x, text_y, scale, color, textStyle ); 
    21802373      break; 
    21812374 
    21822375    case UI_HITEMINFOPANE: 
    2183         UI_DrawInfoPane( &uiInfo.humanItemList[ uiInfo.humanItemIndex ], 
    2184           &rect, text_x, text_y, scale, color, textStyle ); 
     2376      if( ( pane = uiInfo.tremHumanItemList[ uiInfo.tremHumanItemIndex ].infopane ) ) 
     2377        UI_DrawInfoPane( pane, &rect, text_x, text_y, scale, color, textStyle ); 
    21852378      break; 
    21862379 
    21872380    case UI_HBUYINFOPANE: 
    2188         UI_DrawInfoPane( &uiInfo.humanArmouryBuyList[ uiInfo.humanArmouryBuyIndex ], 
    2189           &rect, text_x, text_y, scale, color, textStyle ); 
     2381      if( ( pane = uiInfo.tremHumanArmouryBuyList[ uiInfo.tremHumanArmouryBuyIndex ].infopane ) ) 
     2382        UI_DrawInfoPane( pane, &rect, text_x, text_y, scale, color, textStyle ); 
    21902383      break; 
    21912384 
    21922385    case UI_HSELLINFOPANE: 
    2193         UI_DrawInfoPane( &uiInfo.humanArmourySellList[ uiInfo.humanArmourySellIndex ], 
    2194           &rect, text_x, text_y, scale, color, textStyle ); 
     2386      if( ( pane = uiInfo.tremHumanArmourySellList[ uiInfo.tremHumanArmourySellIndex ].infopane ) ) 
     2387        UI_DrawInfoPane( pane, &rect, text_x, text_y, scale, color, textStyle ); 
    21952388      break; 
    21962389 
    21972390    case UI_ABUILDINFOPANE: 
    2198         UI_DrawInfoPane( &uiInfo.alienBuildList[ uiInfo.alienBuildIndex ], 
    2199           &rect, text_x, text_y, scale, color, textStyle ); 
     2391      if( ( pane = uiInfo.tremAlienBuildList[ uiInfo.tremAlienBuildIndex ].infopane ) ) 
     2392        UI_DrawInfoPane( pane, &rect, text_x, text_y, scale, color, textStyle ); 
    22002393      break; 
    22012394 
    22022395    case UI_HBUILDINFOPANE: 
    2203         UI_DrawInfoPane( &uiInfo.humanBuildList[ uiInfo.humanBuildIndex ], 
    2204           &rect, text_x, text_y, scale, color, textStyle ); 
     2396      if( ( pane = uiInfo.tremHumanBuildList[ uiInfo.tremHumanBuildIndex ].infopane ) ) 
     2397        UI_DrawInfoPane( pane, &rect, text_x, text_y, scale, color, textStyle ); 
    22052398      break; 
    22062399 
     
    29813174/* 
    29823175=============== 
    2983 UI_LoadTeams 
     3176UI_LoadTremTeams 
    29843177=============== 
    29853178*/ 
    2986 static void UI_LoadTeams( void ) 
     3179static void UI_LoadTremTeams( void ) 
    29873180{ 
    29883181  uiInfo.tremTeamCount = 4; 
     
    29903183  uiInfo.tremTeamList[ 0 ].text = String_Alloc( "Aliens" ); 
    29913184  uiInfo.tremTeamList[ 0 ].cmd = String_Alloc( "cmd team aliens\n" ); 
    2992   uiInfo.tremTeamList[ 0 ].type = INFOTYPE_TEXT; 
    2993   uiInfo.tremTeamList[ 0 ].v.text = 
    2994     "The Alien Team\n\n" 
    2995     "The Aliens' strengths are in movement and the ability to " 
    2996     "quickly construct new bases quickly. They possess a range " 
    2997     "of abilities including basic melee attacks, movement-" 
    2998     "crippling poisons and more."; 
     3185  uiInfo.tremTeamList[ 0 ].infopane = UI_FindInfoPaneByName( "alienteam" ); 
    29993186 
    30003187  uiInfo.tremTeamList[ 1 ].text = String_Alloc( "Humans" ); 
    30013188  uiInfo.tremTeamList[ 1 ].cmd = String_Alloc( "cmd team humans\n" ); 
    3002   uiInfo.tremTeamList[ 1 ].type = INFOTYPE_TEXT; 
    3003   uiInfo.tremTeamList[ 1 ].v.text = 
    3004      "The Human Team\n\n" 
    3005      "The humans are the masters of technology. Although their " 
    3006      "bases take long to construct, their automated defense " 
    3007      "ensures they stay built. A wide range of upgrades and " 
    3008      "weapons are available to the humans, each contributing " 
    3009      "to eradicate the alien threat."; 
     3189  uiInfo.tremTeamList[ 1 ].infopane = UI_FindInfoPaneByName( "humanteam" ); 
    30103190 
    30113191  uiInfo.tremTeamList[ 2 ].text = String_Alloc( "Spectate" ); 
    30123192  uiInfo.tremTeamList[ 2 ].cmd = String_Alloc( "cmd team spectate\n" ); 
    3013   uiInfo.tremTeamList[ 2 ].type = INFOTYPE_TEXT; 
    3014   uiInfo.tremTeamList[ 2 ].v.text = "Watch the game without playing."; 
     3193  uiInfo.tremTeamList[ 2 ].infopane = UI_FindInfoPaneByName( "spectateteam" ); 
    30153194 
    30163195  uiInfo.tremTeamList[ 3 ].text = String_Alloc( "Auto select" ); 
    30173196  uiInfo.tremTeamList[ 3 ].cmd = String_Alloc( "cmd team auto\n" ); 
    3018   uiInfo.tremTeamList[ 3 ].type = INFOTYPE_TEXT; 
    3019   uiInfo.tremTeamList[ 3 ].v.text = "Join the team with the least players."; 
     3197  uiInfo.tremTeamList[ 3 ].infopane = UI_FindInfoPaneByName( "autoteam" ); 
    30203198} 
    30213199 
     
    30273205static void UI_AddClass( pClass_t class ) 
    30283206{ 
    3029   uiInfo.alienClassList[ uiInfo.alienClassCount ].text = 
     3207  uiInfo.tremAlienClassList[ uiInfo.tremAlienClassCount ].text = 
    30303208    String_Alloc( BG_FindHumanNameForClassNum( class ) ); 
    3031   uiInfo.alienClassList[ uiInfo.alienClassCount ].cmd = 
     3209  uiInfo.tremAlienClassList[ uiInfo.tremAlienClassCount ].cmd = 
    30323210    String_Alloc( va( "cmd class %s\n", BG_FindNameForClassNum( class ) ) ); 
    3033   uiInfo.alienClassList[ uiInfo.alienClassCount ].type = INFOTYPE_CLASS; 
    3034   uiInfo.alienClassList[ uiInfo.alienClassCount ].v.pclass = class; 
    3035  
    3036   uiInfo.alienClassCount++; 
     3211  uiInfo.tremAlienClassList[ uiInfo.tremAlienClassCount ].infopane = 
     3212    UI_FindInfoPaneByName( va( "%sclass", BG_FindNameForClassNum( class ) ) ); 
     3213 
     3214  uiInfo.tremAlienClassCount++; 
    30373215} 
    30383216 
    30393217/* 
    30403218=============== 
    3041 UI_LoadAlienClasses 
     3219UI_LoadTremAlienClasses 
    30423220=============== 
    30433221*/ 
    3044 static void UI_LoadAlienClasses( void ) 
     3222static void UI_LoadTremAlienClasses( void ) 
    30453223{ 
    3046   uiInfo.alienClassCount = 0; 
     3224  uiInfo.tremAlienClassCount = 0; 
    30473225 
    30483226  if( BG_ClassIsAllowed( PCL_ALIEN_LEVEL0 ) ) 
     
    30633241static void UI_AddItem( weapon_t weapon ) 
    30643242{ 
    3065   uiInfo.humanItemList[ uiInfo.humanItemCount ].text = 
     3243  uiInfo.tremHumanItemList[ uiInfo.tremHumanItemCount ].text = 
    30663244    String_Alloc( BG_FindHumanNameForWeapon( weapon ) ); 
    3067   uiInfo.humanItemList[ uiInfo.humanItemCount ].cmd = 
     3245  uiInfo.tremHumanItemList[ uiInfo.tremHumanItemCount ].cmd = 
    30683246    String_Alloc( va( "cmd class %s\n", BG_FindNameForWeapon( weapon ) ) ); 
    3069   uiInfo.humanItemList[ uiInfo.humanItemCount ].type = INFOTYPE_WEAPON; 
    3070   uiInfo.humanItemList[ uiInfo.humanItemCount ].v.weapon = weapon; 
    3071  
    3072   uiInfo.humanItemCount++; 
     3247  uiInfo.tremHumanItemList[ uiInfo.tremHumanItemCount ].infopane = 
     3248    UI_FindInfoPaneByName( va( "%sitem", BG_FindNameForWeapon( weapon ) ) ); 
     3249 
     3250  uiInfo.tremHumanItemCount++; 
    30733251} 
    30743252 
    30753253/* 
    30763254=============== 
    3077 UI_LoadHumanItems 
     3255UI_LoadTremHumanItems 
    30783256=============== 
    30793257*/ 
    3080 static void UI_LoadHumanItems( void ) 
     3258static void UI_LoadTremHumanItems( void ) 
    30813259{ 
    3082   uiInfo.humanItemCount = 0; 
     3260  uiInfo.tremHumanItemCount = 0; 
    30833261 
    30843262  if( BG_WeaponIsAllowed( WP_MACHINEGUN ) ) 
     
    31543332/* 
    31553333=============== 
    3156 UI_LoadHumanArmouryBuys 
     3334UI_LoadTremHumanArmouryBuys 
    31573335=============== 
    31583336*/ 
    3159 static void UI_LoadHumanArmouryBuys( void ) 
     3337static void UI_LoadTremHumanArmouryBuys( void ) 
    31603338{ 
    31613339  int i, j = 0; 
     
    31783356  } 
    31793357 
    3180   uiInfo.humanArmouryBuyCount = 0; 
     3358  uiInfo.tremHumanArmouryBuyCount = 0; 
    31813359 
    31823360  for( i = WP_NONE + 1; i < WP_NUM_WEAPONS; i++ ) 
     
    31893367        !( weapons & ( 1 << i ) ) ) 
    31903368    { 
    3191       uiInfo.humanArmouryBuyList[ j ].text = 
     3369      uiInfo.tremHumanArmouryBuyList[ j ].text = 
    31923370        String_Alloc( BG_FindHumanNameForWeapon( i ) ); 
    3193       uiInfo.humanArmouryBuyList[ j ].cmd = 
     3371      uiInfo.tremHumanArmouryBuyList[ j ].cmd = 
    31943372        String_Alloc( va( "cmd buy %s retrigger\n", BG_FindNameForWeapon( i ) ) ); 
    3195       uiInfo.humanArmouryBuyList[ j ].type = INFOTYPE_WEAPON; 
    3196       uiInfo.humanArmouryBuyList[ j ].v.weapon = i; 
     3373      uiInfo.tremHumanArmouryBuyList[ j ].infopane = 
     3374        UI_FindInfoPaneByName( va( "%sitem", BG_FindNameForWeapon( i ) ) ); 
    31973375 
    31983376      j++; 
    31993377 
    3200       uiInfo.humanArmouryBuyCount++; 
     3378      uiInfo.tremHumanArmouryBuyCount++; 
    32013379    } 
    32023380  } 
     
    32113389        !( upgrades & ( 1 << i ) ) ) 
    32123390    { 
    3213       uiInfo.humanArmouryBuyList[ j ].text = 
     3391      uiInfo.tremHumanArmouryBuyList[ j ].text = 
    32143392        String_Alloc( BG_FindHumanNameForUpgrade( i ) ); 
    3215       uiInfo.humanArmouryBuyList[ j ].cmd = 
     3393      uiInfo.tremHumanArmouryBuyList[ j ].cmd = 
    32163394        String_Alloc( va( "cmd buy %s retrigger\n", BG_FindNameForUpgrade( i ) ) ); 
    3217       uiInfo.humanArmouryBuyList[ j ].type = INFOTYPE_UPGRADE; 
    3218       uiInfo.humanArmouryBuyList[ j ].v.upgrade = i; 
     3395      uiInfo.tremHumanArmouryBuyList[ j ].infopane = 
     3396        UI_FindInfoPaneByName( va( "%sitem", BG_FindNameForUpgrade( i ) ) ); 
    32193397 
    32203398      j++; 
    32213399 
    3222       uiInfo.humanArmouryBuyCount++; 
     3400      uiInfo.tremHumanArmouryBuyCount++; 
    32233401    } 
    32243402  } 
     
    32273405/* 
    32283406=============== 
    3229 UI_LoadHumanArmourySells 
     3407UI_LoadTremHumanArmourySells 
    32303408=============== 
    32313409*/ 
    3232 static void UI_LoadHumanArmourySells( void ) 
     3410static void UI_LoadTremHumanArmourySells( void ) 
    32333411{ 
    32343412  int weapons, upgrades; 
    32353413  int i, j = 0; 
    32363414 
    3237   uiInfo.humanArmourySellCount = 0; 
     3415  uiInfo.tremHumanArmourySellCount = 0; 
    32383416  UI_ParseCarriageList( &weapons, &upgrades ); 
    32393417 
     
    32423420    if( weapons & ( 1 << i ) ) 
    32433421    { 
    3244       uiInfo.humanArmourySellList[ j ].text = String_Alloc( BG_FindHumanNameForWeapon( i ) ); 
    3245       uiInfo.humanArmourySellList[ j ].cmd = 
     3422      uiInfo.tremHumanArmourySellList[ j ].text = String_Alloc( BG_FindHumanNameForWeapon( i ) ); 
     3423      uiInfo.tremHumanArmourySellList[ j ].cmd = 
    32463424        String_Alloc( va( "cmd sell %s retrigger\n", BG_FindNameForWeapon( i ) ) ); 
    3247       uiInfo.humanArmourySellList[ j ].type = INFOTYPE_WEAPON; 
    3248       uiInfo.humanArmourySellList[ j ].v.weapon = i; 
     3425      uiInfo.tremHumanArmourySellList[ j ].infopane = 
     3426        UI_FindInfoPaneByName( va( "%sitem", BG_FindNameForWeapon( i ) ) ); 
    32493427 
    32503428      j++; 
    32513429 
    3252       uiInfo.humanArmourySellCount++; 
     3430      uiInfo.tremHumanArmourySellCount++; 
    32533431    } 
    32543432  } 
     
    32583436    if( upgrades & ( 1 << i ) ) 
    32593437    { 
    3260       uiInfo.humanArmourySellList[ j ].text = String_Alloc( BG_FindHumanNameForUpgrade( i ) ); 
    3261       uiInfo.humanArmourySellList[ j ].cmd = 
     3438      uiInfo.tremHumanArmourySellList[ j ].text = String_Alloc( BG_FindHumanNameForUpgrade( i ) ); 
     3439      uiInfo.tremHumanArmourySellList[ j ].cmd = 
    32623440        String_Alloc( va( "cmd sell %s retrigger\n", BG_FindNameForUpgrade( i ) ) ); 
    3263       uiInfo.humanArmourySellList[ j ].type = INFOTYPE_UPGRADE; 
    3264       uiInfo.humanArmourySellList[ j ].v.upgrade = i; 
     3441      uiInfo.tremHumanArmourySellList[ j ].infopane = 
     3442        UI_FindInfoPaneByName( va( "%sitem", BG_FindNameForUpgrade( i ) ) ); 
    32653443 
    32663444      j++; 
    32673445 
    3268       uiInfo.humanArmourySellCount++; 
     3446      uiInfo.tremHumanArmourySellCount++; 
    32693447    } 
    32703448  } 
     
    32733451/* 
    32743452=============== 
    3275 UI_LoadAlienUpgrades 
     3453UI_LoadTremAlienUpgrades 
    32763454=============== 
    32773455*/ 
    3278 static void UI_LoadAlienUpgrades( void ) 
     3456static void UI_LoadTremAlienUpgrades( void ) 
    32793457{ 
    32803458  int     i, j = 0; 
     
    32863464  sscanf( ui_currentClass, "%d %d", &class, &credits ); 
    32873465 
    3288   uiInfo.alienUpgradeCount = 0; 
     3466  uiInfo.tremAlienUpgradeCount = 0; 
    32893467 
    32903468  for( i = PCL_NONE + 1; i < PCL_NUM_CLASSES; i++ ) 
     
    32943472        BG_ClassIsAllowed( i ) ) 
    32953473    { 
    3296       uiInfo.alienUpgradeList[ j ].text = String_Alloc( BG_FindHumanNameForClassNum( i ) ); 
    3297       uiInfo.alienUpgradeList[ j ].cmd = 
     3474      uiInfo.tremAlienUpgradeList[ j ].text = String_Alloc( BG_FindHumanNameForClassNum( i ) ); 
     3475      uiInfo.tremAlienUpgradeList[ j ].cmd = 
    32983476        String_Alloc( va( "cmd class %s\n", BG_FindNameForClassNum( i ) ) ); 
    3299       uiInfo.alienUpgradeList[ j ].type = INFOTYPE_CLASS; 
    3300       uiInfo.alienUpgradeList[ j ].v.pclass = i; 
     3477      uiInfo.tremAlienUpgradeList[ j ].infopane = 
     3478        UI_FindInfoPaneByName( va( "%sclass", BG_FindNameForClassNum( i ) ) ); 
    33013479 
    33023480      j++; 
    33033481 
    3304       uiInfo.alienUpgradeCount++; 
     3482      uiInfo.tremAlienUpgradeCount++; 
    33053483    } 
    33063484  } 
     
    33093487/* 
    33103488=============== 
    3311 UI_LoadAlienBuilds 
     3489UI_LoadTremAlienBuilds 
    33123490=============== 
    33133491*/ 
    3314 static void UI_LoadAlienBuilds( void ) 
     3492static void UI_LoadTremAlienBuilds( void ) 
    33153493{ 
    33163494  int     weapons; 
     
    33213499  stage = UI_GetCurrentAlienStage( ); 
    33223500 
    3323   uiInfo.alienBuildCount = 0; 
     3501  uiInfo.tremAlienBuildCount = 0; 
    33243502 
    33253503  for( i = BA_NONE +1; i < BA_NUM_BUILDABLES; i++ ) 
     
    33303508        BG_BuildableIsAllowed( i ) ) 
    33313509    { 
    3332       uiInfo.alienBuildList[ j ].text = 
     3510      uiInfo.tremAlienBuildList[ j ].text = 
    33333511        String_Alloc( BG_FindHumanNameForBuildable( i ) ); 
    3334       uiInfo.alienBuildList[ j ].cmd = 
     3512      uiInfo.tremAlienBuildList[ j ].cmd = 
    33353513        String_Alloc( va( "cmd build %s\n", BG_FindNameForBuildable( i ) ) ); 
    3336       uiInfo.alienBuildList[ j ].type = INFOTYPE_BUILDABLE; 
    3337       uiInfo.alienBuildList[ j ].v.buildable = i; 
     3514      uiInfo.tremAlienBuildList[ j ].infopane = 
     3515        UI_FindInfoPaneByName( va( "%sbuild", BG_FindNameForBuildable( i ) ) ); 
    33383516 
    33393517      j++; 
    33403518 
    3341       uiInfo.alienBuildCount++; 
     3519      uiInfo.tremAlienBuildCount++; 
    33423520    } 
    33433521  } 
     
    33463524/* 
    33473525=============== 
    3348 UI_LoadHumanBuilds 
     3526UI_LoadTremHumanBuilds 
    33493527=============== 
    33503528*/ 
    3351 static void UI_LoadHumanBuilds( void ) 
     3529static void UI_LoadTremHumanBuilds( void ) 
    33523530{ 
    33533531  int     weapons; 
     
    33583536  stage = UI_GetCurrentHumanStage( ); 
    33593537 
    3360   uiInfo.humanBuildCount = 0; 
     3538  uiInfo.tremHumanBuildCount = 0; 
    33613539 
    33623540  for( i = BA_NONE +1; i < BA_NUM_BUILDABLES; i++ ) 
     
    33673545        BG_BuildableIsAllowed( i ) ) 
    33683546    { 
    3369       uiInfo.humanBuildList[ j ].text = 
     3547      uiInfo.tremHumanBuildList[ j ].text = 
    33703548        String_Alloc( BG_FindHumanNameForBuildable( i ) ); 
    3371       uiInfo.humanBuildList[ j ].cmd = 
     3549      uiInfo.tremHumanBuildList[ j ].cmd = 
    33723550        String_Alloc( va( "cmd build %s\n", BG_FindNameForBuildable( i ) ) ); 
    3373       uiInfo.humanBuildList[ j ].type = INFOTYPE_BUILDABLE; 
    3374       uiInfo.humanBuildList[ j ].v.buildable = i; 
     3551      uiInfo.tremHumanBuildList[ j ].infopane = 
     3552        UI_FindInfoPaneByName( va( "%sbuild", BG_FindNameForBuildable( i ) ) ); 
    33753553 
    33763554      j++; 
    33773555 
    3378       uiInfo.humanBuildCount++; 
     3556      uiInfo.tremHumanBuildCount++; 
    33793557    } 
    33803558  } 
     
    38224000      UI_LoadMods(); 
    38234001    } 
     4002 
     4003//TA: tremulous menus 
    38244004    else if( Q_stricmp( name, "LoadTeams" ) == 0 ) 
    3825       UI_LoadTeams( ); 
     4005      UI_LoadTremTeams( ); 
    38264006    else if( Q_stricmp( name, "JoinTeam" ) == 0 ) 
    38274007    { 
     
    38304010    } 
    38314011    else if( Q_stricmp( name, "LoadHumanItems" ) == 0 ) 
    3832       UI_LoadHumanItems( ); 
     4012      UI_LoadTremHumanItems( ); 
    38334013    else if( Q_stricmp( name, "SpawnWithHumanItem" ) == 0 ) 
    38344014    { 
    3835       if( ( cmd = uiInfo.humanItemList[ uiInfo.humanItemIndex ].cmd ) ) 
     4015      if( ( cmd = uiInfo.tremHumanItemList[ uiInfo.tremHumanItemIndex ].cmd ) ) 
    38364016        trap_Cmd_ExecuteText( EXEC_APPEND, cmd ); 
    38374017    } 
    38384018    else if( Q_stricmp( name, "LoadAlienClasses" ) == 0 ) 
    3839       UI_LoadAlienClasses( ); 
     4019      UI_LoadTremAlienClasses( ); 
    38404020    else if( Q_stricmp( name, "SpawnAsAlienClass" ) == 0 ) 
    38414021    { 
    3842       if( ( cmd = uiInfo.alienClassList[ uiInfo.alienClassIndex ].cmd ) ) 
     4022      if( ( cmd = uiInfo.tremAlienClassList[ uiInfo.tremAlienClassIndex ].cmd ) ) 
    38434023        trap_Cmd_ExecuteText( EXEC_APPEND, cmd ); 
    38444024    } 
    38454025    else if( Q_stricmp( name, "LoadHumanArmouryBuys" ) == 0 ) 
    3846       UI_LoadHumanArmouryBuys( ); 
     4026      UI_LoadTremHumanArmouryBuys( ); 
    38474027    else if( Q_stricmp( name, "BuyFromArmoury" ) == 0 ) 
    38484028    { 
    3849       if( ( cmd = uiInfo.humanArmouryBuyList[ uiInfo.humanArmouryBuyIndex ].cmd ) ) 
     4029      if( ( cmd = uiInfo.tremHumanArmouryBuyList[ uiInfo.tremHumanArmouryBuyIndex ].cmd ) ) 
    38504030        trap_Cmd_ExecuteText( EXEC_APPEND, cmd ); 
    38514031    } 
    38524032    else if( Q_stricmp( name, "LoadHumanArmourySells" ) == 0 ) 
    3853       UI_LoadHumanArmourySells( ); 
     4033      UI_LoadTremHumanArmourySells( ); 
    38544034    else if( Q_stricmp( name, "SellToArmoury" ) == 0 ) 
    38554035    { 
    3856       if( ( cmd = uiInfo.humanArmourySellList[ uiInfo.humanArmourySellIndex ].cmd ) ) 
     4036      if( ( cmd = uiInfo.tremHumanArmourySellList[ uiInfo.tremHumanArmourySellIndex ].cmd ) ) 
    38574037        trap_Cmd_ExecuteText( EXEC_APPEND, cmd ); 
    38584038    } 
    38594039    else if( Q_stricmp( name, "LoadAlienUpgrades" ) == 0 ) 
    38604040    { 
    3861       UI_LoadAlienUpgrades( ); 
     4041      UI_LoadTremAlienUpgrades( ); 
    38624042 
    38634043      //disallow the menu if it would be empty 
    3864       if( uiInfo.alienUpgradeCount <= 0 ) 
     4044      if( uiInfo.tremAlienUpgradeCount <= 0 ) 
    38654045        Menus_CloseAll( ); 
    38664046    } 
    38674047    else if( Q_stricmp( name, "UpgradeToNewClass" ) == 0 ) 
    38684048    { 
    3869       if( ( cmd = uiInfo.alienUpgradeList[ uiInfo.alienUpgradeIndex ].cmd ) ) 
     4049      if( ( cmd = uiInfo.tremAlienUpgradeList[ uiInfo.tremAlienUpgradeIndex ].cmd ) ) 
    38704050        trap_Cmd_ExecuteText( EXEC_APPEND, cmd ); 
    38714051    } 
    38724052    else if( Q_stricmp( name, "LoadAlienBuilds" ) == 0 ) 
    3873       UI_LoadAlienBuilds( ); 
     4053      UI_LoadTremAlienBuilds( ); 
    38744054    else if( Q_stricmp( name, "BuildAlienBuildable" ) == 0 ) 
    38754055    { 
    3876       if( ( cmd = uiInfo.alienBuildList[ uiInfo.alienBuildIndex ].cmd ) ) 
     4056      if( ( cmd = uiInfo.tremAlienBuildList[ uiInfo.tremAlienBuildIndex ].cmd ) ) 
    38774057        trap_Cmd_ExecuteText( EXEC_APPEND, cmd ); 
    38784058    } 
    38794059    else if( Q_stricmp( name, "LoadHumanBuilds" ) == 0 ) 
    3880       UI_LoadHumanBuilds( ); 
     4060      UI_LoadTremHumanBuilds( ); 
    38814061    else if( Q_stricmp( name, "BuildHumanBuildable" ) == 0 ) 
    38824062    { 
    3883       if( ( cmd = uiInfo.humanBuildList[ uiInfo.humanBuildIndex ].cmd ) ) 
     4063      if( ( cmd = uiInfo.tremHumanBuildList[ uiInfo.tremHumanBuildIndex ].cmd ) ) 
    38844064        trap_Cmd_ExecuteText( EXEC_APPEND, cmd ); 
    38854065    } 
     
    39054085      } 
    39064086    } 
     4087//TA: tremulous menus 
     4088 
    39074089    else if (Q_stricmp(name, "playMovie") == 0) { 
    39084090      if (uiInfo.previewMovie >= 0) { 
     
    44124594  int i, count, clients, maxClients, ping, game, len, visible; 
    44134595  char info[MAX_STRING_CHARS]; 
     4596//  qboolean startRefresh = qtrue; TTimo: unused 
    44144597  static int numinvisible; 
    44154598 
     
    48925075    return uiInfo.demoCount; 
    48935076  } 
     5077 
     5078//TA: tremulous menus 
    48945079  else if( feederID == FEEDER_TREMTEAMS ) 
    48955080    return uiInfo.tremTeamCount; 
    48965081  else if( feederID == FEEDER_TREMHUMANITEMS ) 
    4897     return uiInfo.humanItemCount; 
     5082    return uiInfo.tremHumanItemCount; 
    48985083  else if( feederID == FEEDER_TREMALIENCLASSES ) 
    4899     return uiInfo.alienClassCount; 
     5084    return uiInfo.tremAlienClassCount; 
    49005085  else if( feederID == FEEDER_TREMHUMANARMOURYBUY ) 
    4901     return uiInfo.humanArmouryBuyCount; 
     5086    return uiInfo.tremHumanArmouryBuyCount; 
    49025087  else if( feederID == FEEDER_TREMHUMANARMOURYSELL ) 
    4903     return uiInfo.humanArmourySellCount; 
     5088    return uiInfo.tremHumanArmourySellCount; 
    49045089  else if( feederID == FEEDER_TREMALIENUPGRADE ) 
    4905     return uiInfo.alienUpgradeCount; 
     5090    return uiInfo.tremAlienUpgradeCount; 
    49065091  else if( feederID == FEEDER_TREMALIENBUILD ) 
    4907     return uiInfo.alienBuildCount; 
     5092    return uiInfo.tremAlienBuildCount; 
    49085093  else if( feederID == FEEDER_TREMHUMANBUILD ) 
    4909     return uiInfo.humanBuildCount; 
     5094    return uiInfo.tremHumanBuildCount; 
     5095//TA: tremulous menus 
    49105096 
    49115097  return 0; 
     
    50885274    } 
    50895275  } 
     5276 
     5277//TA: tremulous menus 
    50905278  else if( feederID == FEEDER_TREMTEAMS ) 
    50915279  { 
     
    50955283  else if( feederID == FEEDER_TREMHUMANITEMS ) 
    50965284  { 
    5097     if( index >= 0 && index < uiInfo.humanItemCount ) 
    5098       return uiInfo.humanItemList[ index ].text; 
     5285    if( index >= 0 && index < uiInfo.tremHumanItemCount ) 
     5286      return uiInfo.tremHumanItemList[ index ].text; 
    50995287  } 
    51005288  else if( feederID == FEEDER_TREMALIENCLASSES ) 
    51015289  { 
    5102     if( index >= 0 && index < uiInfo.alienClassCount ) 
    5103       return uiInfo.alienClassList[ index ].text; 
     5290    if( index >= 0 && index < uiInfo.tremAlienClassCount ) 
     5291      return uiInfo.tremAlienClassList[ index ].text; 
    51045292  } 
    51055293  else if( feederID == FEEDER_TREMHUMANARMOURYBUY ) 
    51065294  { 
    5107     if( index >= 0 && index < uiInfo.humanArmouryBuyCount ) 
    5108       return uiInfo.humanArmouryBuyList[ index ].text; 
     5295    if( index >= 0 && index < uiInfo.tremHumanArmouryBuyCount ) 
     5296      return uiInfo.tremHumanArmouryBuyList[ index ].text; 
    51095297  } 
    51105298  else if( feederID == FEEDER_TREMHUMANARMOURYSELL ) 
    51115299  { 
    5112     if( index >= 0 && index < uiInfo.humanArmourySellCount ) 
    5113       return uiInfo.humanArmourySellList[ index ].text; 
     5300    if( index >= 0 && index < uiInfo.tremHumanArmourySellCount ) 
     5301      return uiInfo.tremHumanArmourySellList[ index ].text; 
    51145302  } 
    51155303  else if( feederID == FEEDER_TREMALIENUPGRADE ) 
    51165304  { 
    5117     if( index >= 0 && index < uiInfo.alienUpgradeCount ) 
    5118       return uiInfo.alienUpgradeList[ index ].text; 
     5305    if( index >= 0 && index < uiInfo.tremAlienUpgradeCount ) 
     5306      return uiInfo.tremAlienUpgradeList[ index ].text; 
    51195307  } 
    51205308  else if( feederID == FEEDER_TREMALIENBUILD ) 
    51215309  { 
    5122     if( index >= 0 && index < uiInfo.alienBuildCount ) 
    5123       return uiInfo.alienBuildList[ index ].text; 
     5310    if( index >= 0 && index < uiInfo.tremAlienBuildCount ) 
     5311      return uiInfo.tremAlienBuildList[ index ].text; 
    51245312  } 
    51255313  else if( feederID == FEEDER_TREMHUMANBUILD ) 
    51265314  { 
    5127     if( index >= 0 && index < uiInfo.humanBuildCount ) 
    5128       return uiInfo.humanBuildList[ index ].text; 
    5129   } 
     5315    if( index >= 0 && index < uiInfo.tremHumanBuildCount ) 
     5316      return uiInfo.tremHumanBuildList[ index ].text; 
     5317  } 
     5318//TA: tremulous menus 
    51305319 
    51315320  return ""; 
     
    52445433    uiInfo.demoIndex = index; 
    52455434  } 
     5435 
     5436//TA: tremulous menus 
    52465437  else if( feederID == FEEDER_TREMTEAMS ) 
    52475438    uiInfo.tremTeamIndex = index; 
    52485439  else if( feederID == FEEDER_TREMHUMANITEMS ) 
    5249     uiInfo.humanItemIndex = index; 
     5440    uiInfo.tremHumanItemIndex = index; 
    52505441  else if( feederID == FEEDER_TREMALIENCLASSES ) 
    5251     uiInfo.alienClassIndex = index; 
     5442    uiInfo.tremAlienClassIndex = index; 
    52525443  else if( feederID == FEEDER_TREMHUMANARMOURYBUY ) 
    5253     uiInfo.humanArmouryBuyIndex = index; 
     5444    uiInfo.tremHumanArmouryBuyIndex = index; 
    52545445  else if( feederID == FEEDER_TREMHUMANARMOURYSELL ) 
    5255     uiInfo.humanArmourySellIndex = index; 
     5446    uiInfo.tremHumanArmourySellIndex = index; 
    52565447  else if( feederID == FEEDER_TREMALIENUPGRADE ) 
    5257     uiInfo.alienUpgradeIndex = index; 
     5448    uiInfo.tremAlienUpgradeIndex = index; 
    52585449  else if( feederID == FEEDER_TREMALIENBUILD ) 
    5259     uiInfo.alienBuildIndex = index; 
     5450    uiInfo.tremAlienBuildIndex = index; 
    52605451  else if( feederID == FEEDER_TREMHUMANBUILD ) 
    5261     uiInfo.humanBuildIndex = index; 
     5452    uiInfo.tremHumanBuildIndex = index; 
     5453//TA: tremulous menus 
    52625454} 
    52635455 
     
    54175609  UI_LoadMenus("ui/ingame.txt", qfalse); 
    54185610  UI_LoadMenus("ui/tremulous.txt", qfalse); 
     5611 
     5612  UI_LoadInfoPanes( "ui/infopanes.def" ); 
     5613 
     5614  if( uiInfo.uiDC.debug ) 
     5615  { 
     5616    int i, j; 
     5617 
     5618    for( i = 0; i < uiInfo.tremInfoPaneCount; i++ ) 
     5619    { 
     5620      Com_Printf( "name: %s\n", uiInfo.tremInfoPanes[ i ].name ); 
     5621 
     5622      Com_Printf( "text: %s\n", uiInfo.tremInfoPanes[ i ].text ); 
     5623 
     5624      for( j = 0; j < uiInfo.tremInfoPanes[ i ].numGraphics; j++ ) 
     5625        Com_Printf( "graphic %d: %d %d %d %d\n", j, uiInfo.tremInfoPanes[ i ].graphics[ j ].side, 
     5626                                                    uiInfo.tremInfoPanes[ i ].graphics[ j ].offset, 
     5627                                                    uiInfo.tremInfoPanes[ i ].graphics[ j ].width, 
     5628                                                    uiInfo.tremInfoPanes[ i ].graphics[ j ].height ); 
     5629    } 
     5630  } 
    54195631 
    54205632  Menus_CloseAll(); 
     
    59656177vmCvar_t  ui_serverStatusTimeOut; 
    59666178 
     6179//TA: bank values 
     6180vmCvar_t  ui_bank; 
    59676181vmCvar_t  ui_winner; 
    59686182 
     6183 
     6184// bk001129 - made static to avoid aliasing 
    59696185static cvarTable_t    cvarTable[] = { 
    59706186  { &ui_ffa_fraglimit, "ui_ffa_fraglimit", "20", CVAR_ARCHIVE }, 
     
    60906306  { &ui_realCaptureLimit, "capturelimit", "8", CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_NORESTART}, 
    60916307  { &ui_serverStatusTimeOut, "ui_serverStatusTimeOut", "7000", CVAR_ARCHIVE}, 
     6308 
     6309  { &ui_bank, "ui_bank", "0", 0 }, 
     6310 
    60926311}; 
    60936312 
     6313// bk001129 - made static to avoid aliasing 
    60946314static int    cvarTableSize = sizeof(cvarTable) / sizeof(cvarTable[0]); 
    60956315 
  • src/ui/ui_players.c

    r122 r0  
    5555static void UI_PlayerInfo_SetWeapon( playerInfo_t *pi, weapon_t weaponNum ) 
    5656{ 
     57  //TA: FIXME: this is probably useless for trem 
     58/*  gitem_t *  item; 
     59  char    path[MAX_QPATH]; 
     60 
     61  pi->currentWeapon = weaponNum; 
     62tryagain: 
     63  pi->realWeapon = weaponNum; 
     64  pi->weaponModel = 0; 
     65  pi->barrelModel = 0; 
     66  pi->flashModel = 0; 
     67 
     68  if ( weaponNum == WP_NONE ) { 
     69    return; 
     70  } 
     71 
     72  if ( item->classname ) { 
     73    pi->weaponModel = trap_R_RegisterModel( item->world_model[0] ); 
     74  } 
     75 
     76  if( pi->weaponModel == 0 ) { 
     77    if( weaponNum == WP_MACHINEGUN ) { 
     78      weaponNum = WP_NONE; 
     79      goto tryagain; 
     80    } 
     81    weaponNum = WP_MACHINEGUN; 
     82    goto tryagain; 
     83  } 
     84 
     85  if ( weaponNum == WP_MACHINEGUN ) { 
     86    strcpy( path, item->world_model[0] ); 
     87    COM_StripExtension( path, path ); 
     88    strcat( path, "_barrel.md3" ); 
     89    pi->barrelModel = trap_R_RegisterModel( path ); 
     90  } 
     91 
     92  strcpy( path, item->world_model[0] ); 
     93  COM_StripExtension( path, path ); 
     94  strcat( path, "_flash.md3" ); 
     95  pi->flashModel = trap_R_RegisterModel( path ); 
     96 
     97  switch( weaponNum ) { 
     98  case WP_GAUNTLET: 
     99    MAKERGB( pi->flashDlightColor, 0.6f, 0.6f, 1 ); 
     100    break; 
     101 
     102  case WP_MACHINEGUN: 
     103    MAKERGB( pi->flashDlightColor, 1, 1, 0 ); 
     104    break; 
     105 
     106  case WP_SHOTGUN: 
     107    MAKERGB( pi->flashDlightColor, 1, 1, 0 ); 
     108    break; 
     109 
     110  case WP_GRENADE_LAUNCHER: 
     111    MAKERGB( pi->flashDlightColor, 1, 0.7f, 0.5f ); 
     112    break; 
     113 
     114  case WP_ROCKET_LAUNCHER: 
     115    MAKERGB( pi->flashDlightColor, 1, 0.75f, 0 ); 
     116    break; 
     117 
     118  case WP_TESLAGEN: 
     119    MAKERGB( pi->flashDlightColor, 0.6f, 0.6f, 1 ); 
     120    break; 
     121 
     122  case WP_RAILGUN: 
     123    MAKERGB( pi->flashDlightColor, 1, 0.5f, 0 ); 
     124    break; 
     125 
     126  case WP_BFG: 
     127    MAKERGB( pi->flashDlightColor, 1, 0.7f, 1 ); 
     128    break; 
     129 
     130  case WP_GRAPPLING_HOOK: 
     131    MAKERGB( pi->flashDlightColor, 0.6f, 0.6f, 1 ); 
     132    break; 
     133 
     134  default: 
     135    MAKERGB( pi->flashDlightColor, 1, 1, 1 ); 
     136    break; 
     137  }*/ 
    57138} 
    58139 
     
    11141195  } 
    11151196 
    1116   if (headModelName[0] == '*' ) { 
     1197  if (headModelName && headModelName[0] == '*' ) { 
    11171198    Com_sprintf( filename, sizeof( filename ), "models/players/heads/%s/%s.md3", &headModelName[1], &headModelName[1] ); 
    11181199  } 
  • src/ui/ui_shared.c

    r118 r0  
    4242static scrollInfo_t scrollInfo; 
    4343 
    44 // prevent compiler warnings 
     44//TA: hack to prevent compiler warnings 
    4545void voidFunction( void *var ) { return; } 
    4646qboolean voidFunction2( itemDef_t *var1, int var2 ) { return qfalse; } 
     
    8484#endif 
    8585 
     86//TA: hacked variable name to avoid conflict with new cgame Alloc 
    8687static char   UI_memoryPool[MEM_POOL_SIZE]; 
    8788static int    allocPoint, outOfMemory; 
     
    542543    Q_strcat(script, 1024, " "); 
    543544  } 
    544   return qfalse; 
     545  return qfalse;  // bk001105 - LCC   missing return value 
    545546} 
    546547 
     
    13521353  sfxHandle_t *sfx = &DC->Assets.itemFocusSound; 
    13531354  qboolean playSound = qfalse; 
    1354   menuDef_t *parent; 
     1355  menuDef_t *parent; // bk001206: = (menuDef_t*)item->parent; 
    13551356  // sanity check, non-null, not a decoration and does not already have the focus 
    13561357  if (item == NULL || item->window.flags & WINDOW_DECORATION || item->window.flags & WINDOW_HASFOCUS || !(item->window.flags & WINDOW_VISIBLE)) { 
     
    13581359  } 
    13591360 
     1361  // bk001206 - this can be NULL. 
    13601362  parent = (menuDef_t*)item->parent; 
    13611363 
     
    24052407    captureData = NULL; 
    24062408  } else { 
     2409    // bk001206 - parentheses 
    24072410    if ( down && ( key == K_MOUSE1 || key == K_MOUSE2 || key == K_MOUSE3 ) ) { 
    24082411      Item_StartCapture(item, key); 
     
    26592662  if (down && !(menu->window.flags & WINDOW_POPUP) && !Rect_ContainsPoint(&menu->window.rect, DC->cursorx, DC->cursory)) { 
    26602663    static qboolean inHandleKey = qfalse; 
     2664    // bk001206 - parentheses 
    26612665    if (!inHandleKey && ( key == K_MOUSE1 || key == K_MOUSE2 || key == K_MOUSE3 ) ) { 
    26622666      inHandleKey = qtrue; 
     
    28382842 
    28392843  if (item->window.flags & WINDOW_HASFOCUS) { 
     2844/*    lowLight[0] = 0.8 * parent->focusColor[0]; 
     2845    lowLight[1] = 0.8 * parent->focusColor[1]; 
     2846    lowLight[2] = 0.8 * parent->focusColor[2]; 
     2847    lowLight[3] = 0.8 * parent->focusColor[3]; 
     2848    LerpColor(parent->focusColor,lowLight,*newColor,0.5+0.5*sin(DC->realTime / PULSE_DIVISOR));*/ 
     2849    //TA: 
    28402850    memcpy(newColor, &parent->focusColor, sizeof(vec4_t)); 
    28412851  } else if (item->textStyle == ITEM_TEXTSTYLE_BLINK && !((DC->realTime/BLINK_DIVISOR) & 1)) { 
     
    28992909    } 
    29002910 
    2901     // forceably split lines that are too long (where normal splitage has failed) 
     2911    //TA: forceably split lines that are too long (where normal splitage has failed) 
    29022912    if( textWidth > item->window.rect.w && newLine == 0 && *p != '\n' ) 
    29032913    { 
     
    30763086      } 
    30773087 
    3078       // forceably split lines that are too long (where normal splitage has failed) 
     3088      //TA: forceably split lines that are too long (where normal splitage has failed) 
    30793089      if( textWidth > item->window.rect.w && newLine == 0 && *p != '\n' ) 
    30803090      { 
     
    32903300 
    32913301  if (item->window.flags & WINDOW_HASFOCUS) { 
     3302/*    lowLight[0] = 0.8 * parent->focusColor[0]; 
     3303    lowLight[1] = 0.8 * parent->focusColor[1]; 
     3304    lowLight[2] = 0.8 * parent->focusColor[2]; 
     3305    lowLight[3] = 0.8 * parent->focusColor[3]; 
     3306    LerpColor(parent->focusColor,lowLight,newColor,0.5+0.5*sin(DC->realTime / PULSE_DIVISOR));*/ 
     3307    //TA: 
    32923308    memcpy(newColor, &parent->focusColor, sizeof(vec4_t)); 
    32933309  } else { 
     
    33133329 
    33143330  if (item->window.flags & WINDOW_HASFOCUS) { 
     3331/*    lowLight[0] = 0.8 * parent->focusColor[0]; 
     3332    lowLight[1] = 0.8 * parent->focusColor[1]; 
     3333    lowLight[2] = 0.8 * parent->focusColor[2]; 
     3334    lowLight[3] = 0.8 * parent->focusColor[3]; 
     3335    LerpColor(parent->focusColor,lowLight,newColor,0.5+0.5*sin(DC->realTime / PULSE_DIVISOR));*/ 
     3336    //TA: 
    33153337    memcpy(newColor, &parent->focusColor, sizeof(vec4_t)); 
    33163338  } else { 
     
    33323354 
    33333355  if (item->window.flags & WINDOW_HASFOCUS) { 
     3356/*    lowLight[0] = 0.8 * parent->focusColor[0]; 
     3357    lowLight[1] = 0.8 * parent->focusColor[1]; 
     3358    lowLight[2] = 0.8 * parent->focusColor[2]; 
     3359    lowLight[3] = 0.8 * parent->focusColor[3]; 
     3360    LerpColor(parent->focusColor,lowLight,newColor,0.5+0.5*sin(DC->realTime / PULSE_DIVISOR));*/ 
     3361    //TA: 
    33343362    memcpy(newColor, &parent->focusColor, sizeof(vec4_t)); 
    33353363  } else { 
     
    33703398  { "+button2",     K_ENTER,       -1, -1, -1 }, 
    33713399  { "+speed",       K_SHIFT,       -1, -1, -1 }, 
    3372   { "boost",        'x',           -1, -1, -1 }, // human sprinting 
     3400  { "boost",        'x',           -1, -1, -1 }, //TA: human sprinting 
    33733401  { "+forward",     K_UPARROW,     -1, -1, -1 }, 
    33743402  { "+back",        K_DOWNARROW,   -1, -1, -1 }, 
     
    33993427  { "weapon 13",    -1,            -1, -1, -1 }, 
    34003428  { "+attack",      K_MOUSE1,      -1, -1, -1 }, 
    3401   { "+button5",     K_MOUSE2,      -1, -1, -1 }, // secondary attack 
    3402   { "reload",       'r',           -1, -1, -1 }, // reload 
    3403   { "buy ammo",     'b',           -1, -1, -1 }, // buy ammo 
    3404   { "itemact medkit", 'm',         -1, -1, -1 }, // use medkit 
    3405   { "+button7",     'q',           -1, -1, -1 }, // buildable use 
    3406   { "deconstruct",  'e',           -1, -1, -1 }, // buildable destroy 
     3429  { "+button5",     K_MOUSE2,      -1, -1, -1 }, //TA: secondary attack 
     3430  { "reload",       'r',           -1, -1, -1 }, //TA: reload 
     3431  { "buy ammo",     'b',           -1, -1, -1 }, //TA: buy ammo 
     3432  { "itemact medkit", 'm',         -1, -1, -1 }, //TA: use medkit 
     3433  { "+button7",     'q',           -1, -1, -1 }, //TA: buildable use 
     3434  { "deconstruct",  'e',           -1, -1, -1 }, //TA: buildable destroy 
    34073435  { "weapprev",     '[',           -1, -1, -1 }, 
    34083436  { "weapnext",     ']',           -1, -1, -1 }, 
     
    34153443  { "scoresUp",      K_KP_PGUP,    -1, -1, -1 }, 
    34163444  { "scoresDown",    K_KP_PGDN,    -1, -1, -1 }, 
     3445  // bk001205 - this one below was:  '-1' 
    34173446  { "messagemode",  -1,            -1, -1, -1 }, 
    34183447  { "messagemode2", -1,            -1, -1, -1 }, 
     
    35973626 
    35983627  if (item->window.flags & WINDOW_HASFOCUS) { 
     3628/*    lowLight[0] = 0.8 * parent->focusColor[0]; 
     3629    lowLight[1] = 0.8 * parent->focusColor[1]; 
     3630    lowLight[2] = 0.8 * parent->focusColor[2]; 
     3631    lowLight[3] = 0.8 * parent->focusColor[3]; 
     3632    LerpColor(parent->focusColor,lowLight,newColor,0.5+0.5*sin(DC->realTime / PULSE_DIVISOR));*/ 
     3633    //TA: 
    35993634    memcpy(newColor, &parent->focusColor, sizeof(vec4_t)); 
    36003635  } else { 
     
    36413676      lowLight[3] = 0.8f * parent->focusColor[3]; 
    36423677    } 
    3643  
     3678    /*LerpColor(parent->focusColor,lowLight,newColor,0.5+0.5*sin(DC->realTime / PULSE_DIVISOR));*/ 
     3679    //TA: 
    36443680    memcpy(newColor, &parent->focusColor, sizeof(vec4_t)); 
    36453681  } else { 
     
    39804016              DC->drawHandlePic(x + 4 + listPtr->columnInfo[j].pos, y - 1 + listPtr->elementHeight / 2, listPtr->columnInfo[j].width, listPtr->columnInfo[j].width, optionalImage); 
    39814017            } else if (text) { 
     4018              //TA: 
    39824019              int alignOffset = 0.0f, tw; 
    39834020 
     
    40324069  } 
    40334070 
    4034   // FIXME: hacky fix to off-by-one bug 
     4071  //TA: FIXME: hacky fix to off-by-one bug 
    40354072  listPtr->endPos--; 
    40364073} 
     
    40634100 
    40644101    if (item->window.flags & WINDOW_HASFOCUS) { 
     4102/*      lowLight[0] = 0.8 * parent->focusColor[0]; 
     4103      lowLight[1] = 0.8 * parent->focusColor[1]; 
     4104      lowLight[2] = 0.8 * parent->focusColor[2]; 
     4105      lowLight[3] = 0.8 * parent->focusColor[3]; 
     4106      LerpColor(parent->focusColor,lowLight,color,0.5+0.5*sin(DC->realTime / PULSE_DIVISOR));*/ 
     4107      //TA: 
    40654108      memcpy(color, &parent->focusColor, sizeof(vec4_t)); 
    40664109    } else if (item->textStyle == ITEM_TEXTSTYLE_BLINK && !((DC->realTime/BLINK_DIVISOR) & 1)) { 
     
    40734116 
    40744117    if (item->cvarFlags & (CVAR_ENABLE | CVAR_DISABLE) && !Item_EnableShowViaCvar(item, CVAR_ENABLE)) { 
    4075       Com_Memcpy(color, parent->disableColor, sizeof(vec4_t)); 
     4118      memcpy(color, parent->disableColor, sizeof(vec4_t)); // bk001207 - FIXME: Com_Memcpy 
    40764119    } 
    40774120 
     
    43754418      m = &Menus[i]; 
    43764419      Menus_Activate(m); 
    4377       Menu_HandleMouseMove( m, DC->cursorx, DC->cursory ); // force the item under the cursor to focus 
    4378  
    4379       for( j = 0; j < m->itemCount; j++ ) // reset selection in listboxes when opened 
     4420      Menu_HandleMouseMove( m, DC->cursorx, DC->cursory ); //TA: force the item under the cursor to focus 
     4421 
     4422      for( j = 0; j < m->itemCount; j++ ) //TA: reset selection in listboxes when opened 
    43804423      { 
    43814424        if( m->items[ j ]->type == ITEM_TYPE_LISTBOX ) 
     
    52145257 
    52155258  } 
    5216   return qfalse; 
     5259  return qfalse;  // bk001205 - LCC missing return value 
    52175260} 
    52185261 
     
    52595302 
    52605303  } 
    5261   return qfalse; 
     5304  return qfalse;  // bk001205 - LCC missing return value 
    52625305} 
    52635306 
     
    54395482    } 
    54405483  } 
    5441   return qfalse; 
     5484  return qfalse;  // bk001205 - LCC missing return value 
    54425485} 
    54435486 
     
    54935536qboolean MenuParse_fullscreen( itemDef_t *item, int handle ) { 
    54945537  menuDef_t *menu = (menuDef_t*)item; 
    5495   if (!PC_Int_Parse(handle, (int*) &menu->fullScreen)) { 
     5538  if (!PC_Int_Parse(handle, (int*) &menu->fullScreen)) { // bk001206 - cast qboolean 
    54965539    return qfalse; 
    54975540  } 
     
    58435886    } 
    58445887  } 
    5845   return qfalse; 
     5888  return qfalse;  // bk001205 - LCC missing return value 
    58465889} 
    58475890 
  • ui/infopanes.def.h

    r7 r0  
    1 #include "../src/game/tremulous.h" 
     1#include "/home/tma/tremulous/src/game/tremulous.h" 
    22 
    33#define CREDITS(X) text "Credits: " text X 
  • ui/menudef.h

    r118 r0  
    6969#define FEEDER_CINEMATICS               0x0f      // cinematics 
    7070 
     71//TA: tremulous menus 
    7172#define FEEDER_TREMTEAMS                0x10      //teams 
    7273#define FEEDER_TREMALIENCLASSES         0x11      //alien classes 
     
    7778#define FEEDER_TREMALIENBUILD           0x16      //alien buildables 
    7879#define FEEDER_TREMHUMANBUILD           0x17      //human buildables 
     80//TA: tremulous menus 
    7981#define FEEDER_IGNORE_LIST              0x18      //ignored players 
    8082 
     
    228230#define CG_CAPTURES 69 
    229231 
    230 // loading screen 
     232//TA: loading screen 
    231233#define CG_LOAD_LEVELSHOT         76 
    232234#define CG_LOAD_MEDIA             77 
     
    316318#define UI_MAPS_SELECTION     256 
    317319 
     320//TA: 
    318321//#define UI_DIALOG             257 
    319322#define UI_TEAMINFOPANE       258