diff --git a/code/game/AI_GalakMech.cpp b/code/game/AI_GalakMech.cpp index d6eda01..89e9146 100644 --- a/code/game/AI_GalakMech.cpp +++ b/code/game/AI_GalakMech.cpp @@ -40,7 +40,7 @@ static qboolean enemyLOS; static qboolean enemyCS; static qboolean hitAlly; static qboolean faceEnemy; -static qboolean move; +static qboolean _move; static qboolean shoot; static float enemyDist; static vec3_t impactPos; @@ -430,7 +430,7 @@ static void GM_CheckMoveState( void ) { if ( Q3_TaskIDPending( NPC, TID_MOVE_NAV ) ) {//moving toward a goal that a script is waiting on, so don't stop for anything! - move = qtrue; + _move = qtrue; } //See if we're moving towards a goal, not the enemy @@ -654,7 +654,7 @@ void NPC_BSGM_Attack( void ) } enemyLOS = enemyCS = qfalse; - move = qtrue; + _move = qtrue; faceEnemy = qfalse; shoot = qfalse; hitAlly = qfalse; @@ -969,7 +969,7 @@ void NPC_BSGM_Attack( void ) } if ( NPCInfo->goalEntity == NPC->enemy ) {//for now, always chase the enemy - move = qtrue; + _move = qtrue; } } if ( enemyCS ) @@ -985,7 +985,7 @@ void NPC_BSGM_Attack( void ) } if ( NPCInfo->goalEntity == NPC->enemy ) {//for now, always chase the enemy - move = qtrue; + _move = qtrue; } } @@ -1048,17 +1048,17 @@ void NPC_BSGM_Attack( void ) if ( !TIMER_Done( NPC, "standTime" ) ) { - move = qfalse; + _move = qfalse; } if ( !(NPCInfo->scriptFlags&SCF_CHASE_ENEMIES) ) {//not supposed to chase my enemies if ( NPCInfo->goalEntity == NPC->enemy ) {//goal is my entity, so don't move - move = qfalse; + _move = qfalse; } } - if ( move && !NPC->lockCount ) + if ( _move && !NPC->lockCount ) {//move toward goal if ( NPCInfo->goalEntity && NPC->client->ps.legsAnim != BOTH_ALERT1 @@ -1067,11 +1067,11 @@ void NPC_BSGM_Attack( void ) && NPC->client->ps.legsAnim != BOTH_ATTACK5 && NPC->client->ps.legsAnim != BOTH_ATTACK7 ) { - move = GM_Move(); + _move = GM_Move(); } else { - move = qfalse; + _move = qfalse; } } @@ -1084,11 +1084,11 @@ void NPC_BSGM_Attack( void ) if ( !faceEnemy ) {//we want to face in the dir we're running - if ( !move ) + if ( _move == qfalse) {//if we haven't moved, we should look in the direction we last looked? VectorCopy( NPC->client->ps.viewangles, NPCInfo->lastPathAngles ); } - if ( move ) + if ( _move == qtrue) {//don't run away and shoot NPCInfo->desiredYaw = NPCInfo->lastPathAngles[YAW]; NPCInfo->desiredPitch = 0; diff --git a/code/game/AI_Grenadier.cpp b/code/game/AI_Grenadier.cpp index 917109a..6000406 100644 --- a/code/game/AI_Grenadier.cpp +++ b/code/game/AI_Grenadier.cpp @@ -37,7 +37,7 @@ qboolean NPC_CheckPlayerTeamStealth( void ); static qboolean enemyLOS; static qboolean enemyCS; static qboolean faceEnemy; -static qboolean move; +static qboolean _move; static qboolean shoot; static float enemyDist; @@ -311,7 +311,7 @@ static void Grenadier_CheckMoveState( void ) { if ( NPCInfo->goalEntity == NPC->enemy ) { - move = qfalse; + _move = qfalse; return; } } @@ -489,7 +489,7 @@ void NPC_BSGrenadier_Attack( void ) } enemyLOS = enemyCS = qfalse; - move = qtrue; + _move = qtrue; faceEnemy = qfalse; shoot = qfalse; enemyDist = DistanceSquared( NPC->enemy->currentOrigin, NPC->currentOrigin ); @@ -580,11 +580,11 @@ void NPC_BSGrenadier_Attack( void ) shoot = qtrue; if ( NPC->client->ps.weapon == WP_THERMAL ) {//don't chase and throw - move = qfalse; + _move = qfalse; } else if ( NPC->client->ps.weapon == WP_MELEE && enemyDist < (NPC->maxs[0]+NPC->enemy->maxs[0]+16)*(NPC->maxs[0]+NPC->enemy->maxs[0]+16) ) {//close enough - move = qfalse; + _move = qfalse; } }//this should make him chase enemy when out of range...? @@ -594,19 +594,19 @@ void NPC_BSGrenadier_Attack( void ) //See if we should override shooting decision with any special considerations Grenadier_CheckFireState(); - if ( move ) + if ( _move ) {//move toward goal if ( NPCInfo->goalEntity )//&& ( NPCInfo->goalEntity != NPC->enemy || enemyDist > 10000 ) )//100 squared { - move = Grenadier_Move(); + _move = Grenadier_Move(); } else { - move = qfalse; + _move = qfalse; } } - if ( !move ) + if ( !_move ) { if ( !TIMER_Done( NPC, "duck" ) ) { @@ -621,7 +621,7 @@ void NPC_BSGrenadier_Attack( void ) if ( !faceEnemy ) {//we want to face in the dir we're running - if ( move ) + if ( _move ) {//don't run away and shoot NPCInfo->desiredYaw = NPCInfo->lastPathAngles[YAW]; NPCInfo->desiredPitch = 0; diff --git a/code/game/AI_Sniper.cpp b/code/game/AI_Sniper.cpp index 8edd1d6..31ff2b8 100644 --- a/code/game/AI_Sniper.cpp +++ b/code/game/AI_Sniper.cpp @@ -38,7 +38,7 @@ qboolean NPC_CheckPlayerTeamStealth( void ); static qboolean enemyLOS; static qboolean enemyCS; static qboolean faceEnemy; -static qboolean move; +static qboolean _move; static qboolean shoot; static float enemyDist; @@ -318,7 +318,7 @@ static void Sniper_CheckMoveState( void ) { if ( NPCInfo->goalEntity == NPC->enemy ) { - move = qfalse; + _move = qfalse; return; } } @@ -338,7 +338,7 @@ static void Sniper_CheckMoveState( void ) { if ( !NPCInfo->goalEntity ) { - move = qfalse; + _move = qfalse; return; } } @@ -668,7 +668,7 @@ void NPC_BSSniper_Attack( void ) } enemyLOS = enemyCS = qfalse; - move = qtrue; + _move = qtrue; faceEnemy = qfalse; shoot = qfalse; enemyDist = DistanceSquared( NPC->currentOrigin, NPC->enemy->currentOrigin ); @@ -759,19 +759,19 @@ void NPC_BSSniper_Attack( void ) //See if we should override shooting decision with any special considerations Sniper_CheckFireState(); - if ( move ) + if ( _move ) {//move toward goal if ( NPCInfo->goalEntity )//&& ( NPCInfo->goalEntity != NPC->enemy || enemyDist > 10000 ) )//100 squared { - move = Sniper_Move(); + _move = Sniper_Move(); } else { - move = qfalse; + _move = qfalse; } } - if ( !move ) + if ( !_move ) { if ( !TIMER_Done( NPC, "duck" ) ) { @@ -804,7 +804,7 @@ void NPC_BSSniper_Attack( void ) if ( !faceEnemy ) {//we want to face in the dir we're running - if ( move ) + if ( _move ) {//don't run away and shoot NPCInfo->desiredYaw = NPCInfo->lastPathAngles[YAW]; NPCInfo->desiredPitch = 0; diff --git a/code/game/AI_Stormtrooper.cpp b/code/game/AI_Stormtrooper.cpp index 2135234..d0f768c 100644 --- a/code/game/AI_Stormtrooper.cpp +++ b/code/game/AI_Stormtrooper.cpp @@ -53,7 +53,7 @@ static qboolean enemyCS; static qboolean enemyInFOV; static qboolean hitAlly; static qboolean faceEnemy; -static qboolean move; +static qboolean _move; static qboolean shoot; static float enemyDist; static vec3_t impactPos; @@ -1186,7 +1186,7 @@ static void ST_CheckMoveState( void ) { if ( Q3_TaskIDPending( NPC, TID_MOVE_NAV ) ) {//moving toward a goal that a script is waiting on, so don't stop for anything! - move = qtrue; + _move = qtrue; } //See if we're a scout else if ( NPCInfo->squadState == SQUAD_SCOUT ) @@ -1194,7 +1194,7 @@ static void ST_CheckMoveState( void ) //If we're supposed to stay put, then stand there and fire if ( TIMER_Done( NPC, "stick" ) == qfalse ) { - move = qfalse; + _move = qfalse; return; } @@ -1207,7 +1207,7 @@ static void ST_CheckMoveState( void ) if ( NPCInfo->goalEntity == NPC->enemy ) { AI_GroupUpdateSquadstates( NPCInfo->group, NPC, SQUAD_STAND_AND_SHOOT ); - move = qfalse; + _move = qfalse; return; } } @@ -1260,20 +1260,20 @@ static void ST_CheckMoveState( void ) return; } - move = qfalse; + _move = qfalse; return; } //see if we're just standing around else if ( NPCInfo->squadState == SQUAD_STAND_AND_SHOOT ) {//from this squadState we can transition to others? - move = qfalse; + _move = qfalse; return; } //see if we're hiding else if ( NPCInfo->squadState == SQUAD_COVER ) { //Should we duck? - move = qfalse; + _move = qfalse; return; } //see if we're just standing around @@ -1281,7 +1281,7 @@ static void ST_CheckMoveState( void ) { if ( !NPCInfo->goalEntity ) { - move = qfalse; + _move = qfalse; return; } } @@ -2452,7 +2452,7 @@ void NPC_BSST_Attack( void ) } enemyLOS = enemyCS = enemyInFOV = qfalse; - move = qtrue; + _move = qtrue; faceEnemy = qfalse; shoot = qfalse; hitAlly = qfalse; @@ -2585,28 +2585,28 @@ void NPC_BSST_Attack( void ) {//not supposed to chase my enemies if ( NPCInfo->goalEntity == NPC->enemy ) {//goal is my entity, so don't move - move = qfalse; + _move = qfalse; } } if ( NPC->client->fireDelay && NPC->s.weapon == WP_ROCKET_LAUNCHER ) { - move = qfalse; + _move = qfalse; } - if ( move ) + if ( _move ) {//move toward goal if ( NPCInfo->goalEntity )//&& ( NPCInfo->goalEntity != NPC->enemy || enemyDist > 10000 ) )//100 squared { - move = ST_Move(); + _move = ST_Move(); } else { - move = qfalse; + _move = qfalse; } } - if ( !move ) + if ( !_move ) { if ( !TIMER_Done( NPC, "duck" ) ) { @@ -2628,14 +2628,14 @@ void NPC_BSST_Attack( void ) if ( !faceEnemy ) {//we want to face in the dir we're running - if ( !move ) + if ( !_move ) {//if we haven't moved, we should look in the direction we last looked? VectorCopy( NPC->client->ps.viewangles, NPCInfo->lastPathAngles ); } NPCInfo->desiredYaw = NPCInfo->lastPathAngles[YAW]; NPCInfo->desiredPitch = 0; NPC_UpdateAngles( qtrue, qtrue ); - if ( move ) + if ( _move ) {//don't run away and shoot shoot = qfalse; } @@ -2679,7 +2679,7 @@ void NPC_BSST_Attack( void ) //NASTY if ( NPC->s.weapon == WP_ROCKET_LAUNCHER && (ucmd.buttons&BUTTON_ATTACK) - && !move + && !_move && g_spskill->integer > 1 && !Q_irand( 0, 3 ) ) {//every now and then, shoot a homing rocket diff --git a/code/game/bg_lib.cpp b/code/game/bg_lib.cpp index 0b1c713..e69de29 100644 --- a/code/game/bg_lib.cpp +++ b/code/game/bg_lib.cpp @@ -1,653 +0,0 @@ -// this include must remain at the top of every bg_xxxx CPP file -#include "common_headers.h" - -//#include "q_shared.h" - -// this file is excluded from release builds because of intrinsics - -#ifdef WIN32 -size_t strlen( const char *string ) { - const char *s; - - s = string; - while ( *s ) { - s++; - } - return s - string; -} - - -char *strcat( char *strDestination, const char *strSource ) { - char *s; - - s = strDestination; - while ( *s ) { - s++; - } - while ( *strSource ) { - *s++ = *strSource++; - } - *s = 0; - return strDestination; -} - -char *strcpy( char *strDestination, const char *strSource ) { - char *s; - - s = strDestination; - while ( *strSource ) { - *s++ = *strSource++; - } - *s = 0; - return strDestination; -} - - -int strcmp( const char *string1, const char *string2 ) { - while ( *string1 == *string2 && *string1 && *string2 ) { - string1++; - string2++; - } - return *string1 - *string2; -} - - -char *strchr( const char *string, int c ) { - do { - if ( *string == c ) { - return ( char * )string; - } - string++; - } while ( *(string-1) ); - return (char *)0; -} - -char *strstr( const char *string, const char *strCharSet ) { - while ( *string ) { - int i; - - for ( i = 0 ; strCharSet[i] ; i++ ) { - if ( string[i] != strCharSet[i] ) { - break; - } - } - if ( !strCharSet[i] ) { - return (char *)string; - } - string++; - } - return (char *)0; -} - -#if 0 -int tolower( int c ) { - if ( c >= 'A' && c <= 'Z' ) { - c += 'a' - 'A'; - } - return c; -} -#endif - -int toupper( int c ) { - if ( c >= 'a' && c <= 'z' ) { - c += 'A' - 'a'; - } - return c; -} -#endif // WIN32 - - -#if 0 - -double floor( double x ) { - return (int)(x + 0x40000000) - 0x40000000; -} - -void *memset( void *dest, int c, size_t count ) { - while ( count-- ) { - ((char *)dest)[count] = c; - } - return dest; -} - -void *memcpy( void *dest, const void *src, size_t count ) { - while ( count-- ) { - ((char *)dest)[count] = ((char *)src)[count]; - } - return dest; -} - -char *strncpy( char *strDest, const char *strSource, size_t count ) { - char *s; - - s = strDest; - while ( *strSource && count ) { - *s++ = *strSource++; - count--; - } - while ( count-- ) { - *s++ = 0; - } - return strDest; -} - -double sqrt( double x ) { - float y; - float delta; - float maxError; - - if ( x <= 0 ) { - return 0; - } - - // initial guess - y = x / 2; - - // refine - maxError = x * 0.001; - - do { - delta = ( y * y ) - x; - y -= delta / ( 2 * y ); - } while ( delta > maxError || delta < -maxError ); - - return y; -} - - -float sintable[1024] = { -0.000000,0.001534,0.003068,0.004602,0.006136,0.007670,0.009204,0.010738, -0.012272,0.013805,0.015339,0.016873,0.018407,0.019940,0.021474,0.023008, -0.024541,0.026075,0.027608,0.029142,0.030675,0.032208,0.033741,0.035274, -0.036807,0.038340,0.039873,0.041406,0.042938,0.044471,0.046003,0.047535, -0.049068,0.050600,0.052132,0.053664,0.055195,0.056727,0.058258,0.059790, -0.061321,0.062852,0.064383,0.065913,0.067444,0.068974,0.070505,0.072035, -0.073565,0.075094,0.076624,0.078153,0.079682,0.081211,0.082740,0.084269, -0.085797,0.087326,0.088854,0.090381,0.091909,0.093436,0.094963,0.096490, -0.098017,0.099544,0.101070,0.102596,0.104122,0.105647,0.107172,0.108697, -0.110222,0.111747,0.113271,0.114795,0.116319,0.117842,0.119365,0.120888, -0.122411,0.123933,0.125455,0.126977,0.128498,0.130019,0.131540,0.133061, -0.134581,0.136101,0.137620,0.139139,0.140658,0.142177,0.143695,0.145213, -0.146730,0.148248,0.149765,0.151281,0.152797,0.154313,0.155828,0.157343, -0.158858,0.160372,0.161886,0.163400,0.164913,0.166426,0.167938,0.169450, -0.170962,0.172473,0.173984,0.175494,0.177004,0.178514,0.180023,0.181532, -0.183040,0.184548,0.186055,0.187562,0.189069,0.190575,0.192080,0.193586, -0.195090,0.196595,0.198098,0.199602,0.201105,0.202607,0.204109,0.205610, -0.207111,0.208612,0.210112,0.211611,0.213110,0.214609,0.216107,0.217604, -0.219101,0.220598,0.222094,0.223589,0.225084,0.226578,0.228072,0.229565, -0.231058,0.232550,0.234042,0.235533,0.237024,0.238514,0.240003,0.241492, -0.242980,0.244468,0.245955,0.247442,0.248928,0.250413,0.251898,0.253382, -0.254866,0.256349,0.257831,0.259313,0.260794,0.262275,0.263755,0.265234, -0.266713,0.268191,0.269668,0.271145,0.272621,0.274097,0.275572,0.277046, -0.278520,0.279993,0.281465,0.282937,0.284408,0.285878,0.287347,0.288816, -0.290285,0.291752,0.293219,0.294685,0.296151,0.297616,0.299080,0.300543, -0.302006,0.303468,0.304929,0.306390,0.307850,0.309309,0.310767,0.312225, -0.313682,0.315138,0.316593,0.318048,0.319502,0.320955,0.322408,0.323859, -0.325310,0.326760,0.328210,0.329658,0.331106,0.332553,0.334000,0.335445, -0.336890,0.338334,0.339777,0.341219,0.342661,0.344101,0.345541,0.346980, -0.348419,0.349856,0.351293,0.352729,0.354164,0.355598,0.357031,0.358463, -0.359895,0.361326,0.362756,0.364185,0.365613,0.367040,0.368467,0.369892, -0.371317,0.372741,0.374164,0.375586,0.377007,0.378428,0.379847,0.381266, -0.382683,0.384100,0.385516,0.386931,0.388345,0.389758,0.391170,0.392582, -0.393992,0.395401,0.396810,0.398218,0.399624,0.401030,0.402435,0.403838, -0.405241,0.406643,0.408044,0.409444,0.410843,0.412241,0.413638,0.415034, -0.416430,0.417824,0.419217,0.420609,0.422000,0.423390,0.424780,0.426168, -0.427555,0.428941,0.430326,0.431711,0.433094,0.434476,0.435857,0.437237, -0.438616,0.439994,0.441371,0.442747,0.444122,0.445496,0.446869,0.448241, -0.449611,0.450981,0.452350,0.453717,0.455084,0.456449,0.457813,0.459177, -0.460539,0.461900,0.463260,0.464619,0.465976,0.467333,0.468689,0.470043, -0.471397,0.472749,0.474100,0.475450,0.476799,0.478147,0.479494,0.480839, -0.482184,0.483527,0.484869,0.486210,0.487550,0.488889,0.490226,0.491563, -0.492898,0.494232,0.495565,0.496897,0.498228,0.499557,0.500885,0.502212, -0.503538,0.504863,0.506187,0.507509,0.508830,0.510150,0.511469,0.512786, -0.514103,0.515418,0.516732,0.518045,0.519356,0.520666,0.521975,0.523283, -0.524590,0.525895,0.527199,0.528502,0.529804,0.531104,0.532403,0.533701, -0.534998,0.536293,0.537587,0.538880,0.540171,0.541462,0.542751,0.544039, -0.545325,0.546610,0.547894,0.549177,0.550458,0.551738,0.553017,0.554294, -0.555570,0.556845,0.558119,0.559391,0.560662,0.561931,0.563199,0.564466, -0.565732,0.566996,0.568259,0.569521,0.570781,0.572040,0.573297,0.574553, -0.575808,0.577062,0.578314,0.579565,0.580814,0.582062,0.583309,0.584554, -0.585798,0.587040,0.588282,0.589521,0.590760,0.591997,0.593232,0.594466, -0.595699,0.596931,0.598161,0.599389,0.600616,0.601842,0.603067,0.604290, -0.605511,0.606731,0.607950,0.609167,0.610383,0.611597,0.612810,0.614022, -0.615232,0.616440,0.617647,0.618853,0.620057,0.621260,0.622461,0.623661, -0.624859,0.626056,0.627252,0.628446,0.629638,0.630829,0.632019,0.633207, -0.634393,0.635578,0.636762,0.637944,0.639124,0.640303,0.641481,0.642657, -0.643832,0.645005,0.646176,0.647346,0.648514,0.649681,0.650847,0.652011, -0.653173,0.654334,0.655493,0.656651,0.657807,0.658961,0.660114,0.661266, -0.662416,0.663564,0.664711,0.665856,0.667000,0.668142,0.669283,0.670422, -0.671559,0.672695,0.673829,0.674962,0.676093,0.677222,0.678350,0.679476, -0.680601,0.681724,0.682846,0.683965,0.685084,0.686200,0.687315,0.688429, -0.689541,0.690651,0.691759,0.692866,0.693971,0.695075,0.696177,0.697278, -0.698376,0.699473,0.700569,0.701663,0.702755,0.703845,0.704934,0.706021, -0.707107,0.708191,0.709273,0.710353,0.711432,0.712509,0.713585,0.714659, -0.715731,0.716801,0.717870,0.718937,0.720003,0.721066,0.722128,0.723188, -0.724247,0.725304,0.726359,0.727413,0.728464,0.729514,0.730563,0.731609, -0.732654,0.733697,0.734739,0.735779,0.736817,0.737853,0.738887,0.739920, -0.740951,0.741980,0.743008,0.744034,0.745058,0.746080,0.747101,0.748119, -0.749136,0.750152,0.751165,0.752177,0.753187,0.754195,0.755201,0.756206, -0.757209,0.758210,0.759209,0.760207,0.761202,0.762196,0.763188,0.764179, -0.765167,0.766154,0.767139,0.768122,0.769103,0.770083,0.771061,0.772036, -0.773010,0.773983,0.774953,0.775922,0.776888,0.777853,0.778817,0.779778, -0.780737,0.781695,0.782651,0.783605,0.784557,0.785507,0.786455,0.787402, -0.788346,0.789289,0.790230,0.791169,0.792107,0.793042,0.793975,0.794907, -0.795837,0.796765,0.797691,0.798615,0.799537,0.800458,0.801376,0.802293, -0.803208,0.804120,0.805031,0.805940,0.806848,0.807753,0.808656,0.809558, -0.810457,0.811355,0.812251,0.813144,0.814036,0.814926,0.815814,0.816701, -0.817585,0.818467,0.819348,0.820226,0.821103,0.821977,0.822850,0.823721, -0.824589,0.825456,0.826321,0.827184,0.828045,0.828904,0.829761,0.830616, -0.831470,0.832321,0.833170,0.834018,0.834863,0.835706,0.836548,0.837387, -0.838225,0.839060,0.839894,0.840725,0.841555,0.842383,0.843208,0.844032, -0.844854,0.845673,0.846491,0.847307,0.848120,0.848932,0.849742,0.850549, -0.851355,0.852159,0.852961,0.853760,0.854558,0.855354,0.856147,0.856939, -0.857729,0.858516,0.859302,0.860085,0.860867,0.861646,0.862424,0.863199, -0.863973,0.864744,0.865514,0.866281,0.867046,0.867809,0.868571,0.869330, -0.870087,0.870842,0.871595,0.872346,0.873095,0.873842,0.874587,0.875329, -0.876070,0.876809,0.877545,0.878280,0.879012,0.879743,0.880471,0.881197, -0.881921,0.882643,0.883363,0.884081,0.884797,0.885511,0.886223,0.886932, -0.887640,0.888345,0.889048,0.889750,0.890449,0.891146,0.891841,0.892534, -0.893224,0.893913,0.894599,0.895284,0.895966,0.896646,0.897325,0.898001, -0.898674,0.899346,0.900016,0.900683,0.901349,0.902012,0.902673,0.903332, -0.903989,0.904644,0.905297,0.905947,0.906596,0.907242,0.907886,0.908528, -0.909168,0.909806,0.910441,0.911075,0.911706,0.912335,0.912962,0.913587, -0.914210,0.914830,0.915449,0.916065,0.916679,0.917291,0.917901,0.918508, -0.919114,0.919717,0.920318,0.920917,0.921514,0.922109,0.922701,0.923291, -0.923880,0.924465,0.925049,0.925631,0.926210,0.926787,0.927363,0.927935, -0.928506,0.929075,0.929641,0.930205,0.930767,0.931327,0.931884,0.932440, -0.932993,0.933544,0.934093,0.934639,0.935184,0.935726,0.936266,0.936803, -0.937339,0.937872,0.938404,0.938932,0.939459,0.939984,0.940506,0.941026, -0.941544,0.942060,0.942573,0.943084,0.943593,0.944100,0.944605,0.945107, -0.945607,0.946105,0.946601,0.947094,0.947586,0.948075,0.948561,0.949046, -0.949528,0.950008,0.950486,0.950962,0.951435,0.951906,0.952375,0.952842, -0.953306,0.953768,0.954228,0.954686,0.955141,0.955594,0.956045,0.956494, -0.956940,0.957385,0.957826,0.958266,0.958703,0.959139,0.959572,0.960002, -0.960431,0.960857,0.961280,0.961702,0.962121,0.962538,0.962953,0.963366, -0.963776,0.964184,0.964590,0.964993,0.965394,0.965793,0.966190,0.966584, -0.966976,0.967366,0.967754,0.968139,0.968522,0.968903,0.969281,0.969657, -0.970031,0.970403,0.970772,0.971139,0.971504,0.971866,0.972226,0.972584, -0.972940,0.973293,0.973644,0.973993,0.974339,0.974684,0.975025,0.975365, -0.975702,0.976037,0.976370,0.976700,0.977028,0.977354,0.977677,0.977999, -0.978317,0.978634,0.978948,0.979260,0.979570,0.979877,0.980182,0.980485, -0.980785,0.981083,0.981379,0.981673,0.981964,0.982253,0.982539,0.982824, -0.983105,0.983385,0.983662,0.983937,0.984210,0.984480,0.984749,0.985014, -0.985278,0.985539,0.985798,0.986054,0.986308,0.986560,0.986809,0.987057, -0.987301,0.987544,0.987784,0.988022,0.988258,0.988491,0.988722,0.988950, -0.989177,0.989400,0.989622,0.989841,0.990058,0.990273,0.990485,0.990695, -0.990903,0.991108,0.991311,0.991511,0.991710,0.991906,0.992099,0.992291, -0.992480,0.992666,0.992850,0.993032,0.993212,0.993389,0.993564,0.993737, -0.993907,0.994075,0.994240,0.994404,0.994565,0.994723,0.994879,0.995033, -0.995185,0.995334,0.995481,0.995625,0.995767,0.995907,0.996045,0.996180, -0.996313,0.996443,0.996571,0.996697,0.996820,0.996941,0.997060,0.997176, -0.997290,0.997402,0.997511,0.997618,0.997723,0.997825,0.997925,0.998023, -0.998118,0.998211,0.998302,0.998390,0.998476,0.998559,0.998640,0.998719, -0.998795,0.998870,0.998941,0.999011,0.999078,0.999142,0.999205,0.999265, -0.999322,0.999378,0.999431,0.999481,0.999529,0.999575,0.999619,0.999660, -0.999699,0.999735,0.999769,0.999801,0.999831,0.999858,0.999882,0.999905, -0.999925,0.999942,0.999958,0.999971,0.999981,0.999989,0.999995,0.999999 -}; - -double sin( double x ) { - int index; - int quad; - - index = 1024 * x / (M_PI * 0.5); - quad = ( index >> 10 ) & 3; - index &= 1023; - switch ( quad ) { - case 0: - return sintable[index]; - case 1: - return sintable[1023-index]; - case 2: - return -sintable[index]; - case 3: - return -sintable[1023-index]; - } - return 0; -} - - -double cos( double x ) { - int index; - int quad; - - index = 1024 * x / (M_PI * 0.5); - quad = ( index >> 10 ) & 3; - index &= 1023; - switch ( quad ) { - case 3: - return sintable[index]; - case 0: - return sintable[1023-index]; - case 1: - return -sintable[index]; - case 2: - return -sintable[1023-index]; - } - return 0; -} - - -double atan2( double y, double x ) { - float base; - float temp; - float dir; - float test; - int i; - - if ( x < 0 ) { - if ( y >= 0 ) { - // quad 1 - base = M_PI / 2; - temp = x; - x = y; - y = -temp; - } else { - // quad 2 - base = M_PI; - x = -x; - y = -y; - } - } else { - if ( y < 0 ) { - // quad 3 - base = 3 * M_PI / 2; - temp = x; - x = -y; - y = temp; - } - } - - if ( y > x ) { - base += M_PI/2; - temp = x; - x = y; - y = temp; - dir = -1; - } else { - dir = 1; - } - - // calcualte angle in octant 0 - if ( x == 0 ) { - return base; - } - y /= x; - - for ( i = 0 ; i < 512 ; i++ ) { - test = sintable[i] / sintable[1023-i]; - if ( test > y ) { - break; - } - } - - return base + dir * i * ( M_PI/2048); -} - - -#endif - -double tan( double x ) { - return sin(x) / cos(x); -} - - -static int randSeed = 0; - -int rand( void ) { - randSeed = (69069 * randSeed + 1); - return randSeed & 0x7fff; -} - -double atof( const char *string ) { - double sign; - double value; - int c; - - - // skip whitespace - while ( *string <= ' ' ) { - if ( !*string ) { - return 0; - } - string++; - } - - // check sign - switch ( *string ) { - case '+': - string++; - sign = 1; - break; - case '-': - string++; - sign = -1; - break; - default: - sign = 1; - break; - } - - // read digits - value = 0; - do { - c = *string++; - if ( c < '0' || c > '9' ) { - break; - } - c -= '0'; - value = value * 10 + c; - } while ( 1 ); - - // check for decimal point - if ( c == '.' ) { - double fraction; - - string++; - fraction = 0.1; - do { - c = *string++; - if ( c < '0' || c > '9' ) { - break; - } - c -= '0'; - value += c * fraction; - fraction *= 0.1; - } while ( 1 ); - - } - - // not handling 10e10 notation... - - return value * sign; -} - -#ifndef _MSC_VER - -int atoi( const char *string ) { - int sign; - int value; - int c; - - - // skip whitespace - while ( *string <= ' ' ) { - if ( !*string ) { - return 0; - } - string++; - } - - // check sign - switch ( *string ) { - case '+': - string++; - sign = 1; - break; - case '-': - string++; - sign = -1; - break; - default: - sign = 1; - break; - } - - // read digits - value = 0; - do { - c = *string++; - if ( c < '0' || c > '9' ) { - break; - } - c -= '0'; - value = value * 10 + c; - } while ( 1 ); - - // not handling 10e10 notation... - - return value * sign; -} - -#endif - -int abs( int n ) { - return n < 0 ? -n : n; -} - -double fabs( double x ) { - return x < 0 ? -x : x; -} - - - -//========================================================= - - -void AddInt( char **buf_p, int val, int width ) { - char text[32]; - int digits; - int signedVal; - char *buf; - - digits = 0; - signedVal = val; - if ( val < 0 ) { - val = -val; - } - do { - text[digits++] = '0' + val % 10; - val /= 10; - } while ( val ); - - if ( signedVal < 0 ) { - text[digits++] = '-'; - } - - buf = *buf_p; - - while ( digits < width ) { - *buf++ = ' '; - width--; - } - - while ( digits-- ) { - *buf++ = text[digits]; - } - - *buf_p = buf; -} - -void AddFloat( char **buf_p, float fval, int width ) { - char text[32]; - int digits; - float signedVal; - char *buf; - int val; - - // FIXME!!!! handle fractions - - digits = 0; - signedVal = fval; - if ( fval < 0 ) { - fval = -fval; - } - - val = (int)fval; - do { - text[digits++] = '0' + val % 10; - val /= 10; - } while ( val ); - - if ( signedVal < 0 ) { - text[digits++] = '-'; - } - - buf = *buf_p; - - while ( digits < width ) { - *buf++ = ' '; - width--; - } - - while ( digits-- ) { - *buf++ = text[digits]; - } - - *buf_p = buf; -} - -int vsprintf( char *buffer, const char *fmt, va_list argptr ) { - char *buf_p; - int cmd; - int *arg; - char *s; - int width; - - buf_p = buffer; - arg = (int *)argptr; - - while ( *fmt ) { - if ( fmt[0] != '%' ) { - *buf_p++ = *fmt++; - continue; - } - - cmd = fmt[1]; - if ( cmd >= '0' && cmd <= '9' ) { - width = cmd - '0'; - cmd = fmt[2]; - fmt++; - } else { - width = 0; - } - fmt += 2; - - switch ( cmd ) { - case 'i': - case 'd': - case 'u': - AddInt( &buf_p, *arg, width ); - break; - - case 'f': - AddFloat( &buf_p, *(float *)arg, width ); - break; - - case 's': - s = (char *)*arg; - if ( !s ) { - s = ""; - } - while ( *s ) { - *buf_p++ = *s++; - } - break; - } - arg++; - } - - *buf_p = 0; - return buf_p - buffer; -} - diff --git a/code/game/bg_pmove.cpp b/code/game/bg_pmove.cpp index 9910a64..32bc43d 100644 --- a/code/game/bg_pmove.cpp +++ b/code/game/bg_pmove.cpp @@ -2379,7 +2379,7 @@ static qboolean PM_TryRoll( void ) return qfalse; } } - vec3_t fwd, right, traceto, mins = {pm->mins[0],pm->mins[1],pm->mins[2]+STEPSIZE}, maxs = {pm->maxs[0],pm->maxs[1],pm->gent->client->crouchheight}, fwdAngles = {0, pm->ps->viewangles[YAW], 0}; + vec3_t fwd, right, traceto, mins = {pm->mins[0],pm->mins[1],pm->mins[2]+STEPSIZE}, maxs = {pm->maxs[0],pm->maxs[1],static_cast(pm->gent->client->crouchheight)}, fwdAngles = {0, pm->ps->viewangles[YAW], 0}; trace_t trace; int anim = -1; AngleVectors( fwdAngles, fwd, right, NULL ); diff --git a/code/game/fields.h b/code/game/fields.h index 5ef253b..5d9a182 100644 --- a/code/game/fields.h +++ b/code/game/fields.h @@ -66,7 +66,7 @@ typedef enum typedef struct { char *psName; - int iOffset; + size_t iOffset; fieldtypeSAVE_t eFieldType; int iFlags; } field_t; diff --git a/code/game/g_spawn.cpp b/code/game/g_spawn.cpp index 274d95a..0c28932 100644 --- a/code/game/g_spawn.cpp +++ b/code/game/g_spawn.cpp @@ -161,7 +161,7 @@ typedef enum { typedef struct { char *name; - int ofs; + size_t ofs; fieldtype_t type; int flags; } field_t; diff --git a/code/game/g_weapon.cpp b/code/game/g_weapon.cpp index 0f2e660..abd72f7 100644 --- a/code/game/g_weapon.cpp +++ b/code/game/g_weapon.cpp @@ -13,7 +13,7 @@ #include "b_local.h" #include "../cgame/cg_local.h" -static vec3_t forward, vright, up; +static vec3_t _forward, vright, up; static vec3_t muzzle; void drop_charge(gentity_t *ent, vec3_t start, vec3_t dir); @@ -312,7 +312,7 @@ void WP_Explode( gentity_t *self ) //----------------------------------------------------------------------------- { gentity_t *attacker = self; - vec3_t forward; + vec3_t _forward; // stop chain reaction runaway loops self->takedamage = qfalse; @@ -320,11 +320,11 @@ void WP_Explode( gentity_t *self ) self->s.loopSound = 0; // VectorCopy( self->currentOrigin, self->s.pos.trBase ); - AngleVectors( self->s.angles, forward, NULL, NULL ); + AngleVectors( self->s.angles, _forward, NULL, NULL ); if ( self->fxID > 0 ) { - G_PlayEffect( self->fxID, self->currentOrigin, forward ); + G_PlayEffect( self->fxID, self->currentOrigin, _forward ); } if ( self->owner ) @@ -488,7 +488,7 @@ static void WP_FireBryarPistol( gentity_t *ent, qboolean alt_fire ) { vec3_t angs; - vectoangles( forward, angs ); + vectoangles( _forward, angs ); if ( ent->client->NPC_class == CLASS_IMPWORKER ) {//*sigh*, hack to make impworkers less accurate without affecteing imperial officer accuracy @@ -501,10 +501,10 @@ static void WP_FireBryarPistol( gentity_t *ent, qboolean alt_fire ) angs[YAW] += ( crandom() * ((5-ent->NPC->currentAim)*0.25f) ); } - AngleVectors( angs, forward, NULL, NULL ); + AngleVectors( angs, _forward, NULL, NULL ); } - gentity_t *missile = CreateMissile( start, forward, BRYAR_PISTOL_VEL, 10000, ent, alt_fire ); + gentity_t *missile = CreateMissile( start, _forward, BRYAR_PISTOL_VEL, 10000, ent, alt_fire ); missile->classname = "bryar_proj"; missile->s.weapon = WP_BRYAR_PISTOL; @@ -632,7 +632,7 @@ static void WP_FireBlaster( gentity_t *ent, qboolean alt_fire ) { vec3_t dir, angs; - vectoangles( forward, angs ); + vectoangles( _forward, angs ); if ( alt_fire ) { @@ -728,7 +728,7 @@ static void WP_DisruptorMainFire( gentity_t *ent ) // damage *= 2; // } - VectorMA( start, shotRange, forward, end ); + VectorMA( start, shotRange, _forward, end ); int ignore = ent->s.number; int traces = 0; @@ -776,11 +776,11 @@ static void WP_DisruptorMainFire( gentity_t *ent ) int hitLoc = G_GetHitLocFromTrace( &tr, MOD_DISRUPTOR ); if ( traceEnt && traceEnt->client && traceEnt->client->NPC_class == CLASS_GALAKMECH ) {//hehe - G_Damage( traceEnt, ent, ent, forward, tr.endpos, 3, DAMAGE_DEATH_KNOCKBACK, MOD_DISRUPTOR, hitLoc ); + G_Damage( traceEnt, ent, ent, _forward, tr.endpos, 3, DAMAGE_DEATH_KNOCKBACK, MOD_DISRUPTOR, hitLoc ); } else { - G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage, DAMAGE_DEATH_KNOCKBACK, MOD_DISRUPTOR, hitLoc ); + G_Damage( traceEnt, ent, ent, _forward, tr.endpos, damage, DAMAGE_DEATH_KNOCKBACK, MOD_DISRUPTOR, hitLoc ); } } else @@ -794,10 +794,10 @@ static void WP_DisruptorMainFire( gentity_t *ent ) for ( dist = 0; dist < shotDist; dist += 64 ) { //FIXME: on a really long shot, this could make a LOT of alerts in one frame... - VectorMA( start, dist, forward, spot ); + VectorMA( start, dist, _forward, spot ); AddSightEvent( ent, spot, 256, AEL_DISCOVERED, 50 ); } - VectorMA( start, shotDist-4, forward, spot ); + VectorMA( start, shotDist-4, _forward, spot ); AddSightEvent( ent, spot, 256, AEL_DISCOVERED, 50 ); } @@ -839,7 +839,7 @@ void WP_DisruptorAltFire( gentity_t *ent ) else { VectorCopy( ent->client->renderInfo.eyePoint, start ); - AngleVectors( ent->client->renderInfo.eyeAngles, forward, NULL, NULL ); + AngleVectors( ent->client->renderInfo.eyeAngles, _forward, NULL, NULL ); // don't let NPC's do charging int count = ( level.time - ent->client->ps.weaponChargeTime - 50 ) / DISRUPTOR_CHARGE_UNIT; @@ -878,7 +878,7 @@ void WP_DisruptorAltFire( gentity_t *ent ) for ( int i = 0; i < traces; i++ ) { - VectorMA( start, shotRange, forward, end ); + VectorMA( start, shotRange, _forward, end ); //NOTE: if you want to be able to hit guys in emplaced guns, use "G2_COLLIDE, 10" instead of "G2_RETURNONHIT, 0" //alternately, if you end up hitting an emplaced_gun that has a sitter, just redo this one trace with the "G2_COLLIDE, 10" to see if we it the sitter @@ -940,10 +940,10 @@ void WP_DisruptorAltFire( gentity_t *ent ) int hitLoc = G_GetHitLocFromTrace( &tr, MOD_DISRUPTOR ); if ( traceEnt && traceEnt->client && traceEnt->client->NPC_class == CLASS_GALAKMECH ) {//hehe - G_Damage( traceEnt, ent, ent, forward, tr.endpos, 10, DAMAGE_NO_KNOCKBACK|DAMAGE_NO_HIT_LOC, fullCharge ? MOD_SNIPER : MOD_DISRUPTOR, hitLoc ); + G_Damage( traceEnt, ent, ent, _forward, tr.endpos, 10, DAMAGE_NO_KNOCKBACK|DAMAGE_NO_HIT_LOC, fullCharge ? MOD_SNIPER : MOD_DISRUPTOR, hitLoc ); break; } - G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage, DAMAGE_NO_KNOCKBACK|DAMAGE_NO_HIT_LOC, fullCharge ? MOD_SNIPER : MOD_DISRUPTOR, hitLoc ); + G_Damage( traceEnt, ent, ent, _forward, tr.endpos, damage, DAMAGE_NO_KNOCKBACK|DAMAGE_NO_HIT_LOC, fullCharge ? MOD_SNIPER : MOD_DISRUPTOR, hitLoc ); } else { @@ -979,7 +979,7 @@ void WP_DisruptorAltFire( gentity_t *ent ) AddSightEvent( ent, spot, 256, AEL_DISCOVERED, 50 ); } //FIXME: spawn a temp ent that continuously spawns sight alerts here? And 1 sound alert to draw their attention? - VectorMA( start, shotDist-4, forward, spot ); + VectorMA( start, shotDist-4, _forward, spot ); AddSightEvent( ent, spot, 256, AEL_DISCOVERED, 50 ); } @@ -996,7 +996,7 @@ static void WP_FireDisruptor( gentity_t *ent, qboolean alt_fire ) WP_DisruptorMainFire( ent ); } - G_PlayEffect( G_EffectIndex( "disruptor/line_cap" ), muzzle, forward ); + G_PlayEffect( G_EffectIndex( "disruptor/line_cap" ), muzzle, _forward ); } @@ -1061,7 +1061,7 @@ static void WP_BowcasterMainFire( gentity_t *ent ) // create a range of different velocities vel = BOWCASTER_VELOCITY * ( crandom() * BOWCASTER_VEL_RANGE + 1.0f ); - vectoangles( forward, angs ); + vectoangles( _forward, angs ); // add some slop to the fire direction angs[PITCH] += crandom() * BOWCASTER_ALT_SPREAD * 0.2f; @@ -1110,7 +1110,7 @@ static void WP_BowcasterAltFire( gentity_t *ent ) VectorCopy( muzzle, start ); WP_TraceSetStart( ent, start, vec3_origin, vec3_origin );//make sure our start point isn't on the other side of a wall - gentity_t *missile = CreateMissile( start, forward, BOWCASTER_VELOCITY, 10000, ent, qtrue ); + gentity_t *missile = CreateMissile( start, _forward, BOWCASTER_VELOCITY, 10000, ent, qtrue ); missile->classname = "bowcaster_alt_proj"; missile->s.weapon = WP_BOWCASTER; @@ -1237,7 +1237,7 @@ static void WP_RepeaterAltFire( gentity_t *ent ) } else { - missile = CreateMissile( start, forward, REPEATER_ALT_VELOCITY, 10000, ent, qtrue ); + missile = CreateMissile( start, _forward, REPEATER_ALT_VELOCITY, 10000, ent, qtrue ); } missile->classname = "repeater_alt_proj"; @@ -1291,7 +1291,7 @@ static void WP_FireRepeater( gentity_t *ent, qboolean alt_fire ) { vec3_t dir, angs; - vectoangles( forward, angs ); + vectoangles( _forward, angs ); if ( alt_fire ) { @@ -1337,7 +1337,7 @@ static void WP_DEMP2_MainFire( gentity_t *ent ) VectorCopy( muzzle, start ); WP_TraceSetStart( ent, start, vec3_origin, vec3_origin );//make sure our start point isn't on the other side of a wall - gentity_t *missile = CreateMissile( start, forward, DEMP2_VELOCITY, 10000, ent ); + gentity_t *missile = CreateMissile( start, _forward, DEMP2_VELOCITY, 10000, ent ); missile->classname = "demp2_proj"; missile->s.weapon = WP_DEMP2; @@ -1514,7 +1514,7 @@ static void WP_DEMP2_AltFire( gentity_t *ent ) // the shot can travel a whopping 4096 units in 1 second. Note that the shot will auto-detonate at 4096 units...we'll see if this looks cool or not - gentity_t *missile = CreateMissile( start, forward, DEMP2_ALT_RANGE, 1000, ent, qtrue ); + gentity_t *missile = CreateMissile( start, _forward, DEMP2_ALT_RANGE, 1000, ent, qtrue ); // letting it know what the charge size is. missile->count = count; @@ -1583,7 +1583,7 @@ static void WP_FlechetteMainFire( gentity_t *ent ) for ( int i = 0; i < FLECHETTE_SHOTS; i++ ) { - vectoangles( forward, angs ); + vectoangles( _forward, angs ); if ( i == 0 && ent->s.number == 0 ) { @@ -1780,7 +1780,7 @@ static void WP_FlechetteAltFire( gentity_t *self ) { vec3_t dir, fwd, start, angs; - vectoangles( forward, angs ); + vectoangles( _forward, angs ); VectorCopy( muzzle, start ); WP_TraceSetStart( self, start, vec3_origin, vec3_origin );//make sure our start point isn't on the other side of a wall @@ -1937,7 +1937,7 @@ static void WP_FireRocket( gentity_t *ent, qboolean alt_fire ) VectorCopy( muzzle, start ); WP_TraceSetStart( ent, start, vec3_origin, vec3_origin );//make sure our start point isn't on the other side of a wall - gentity_t *missile = CreateMissile( start, forward, vel, 10000, ent, alt_fire ); + gentity_t *missile = CreateMissile( start, _forward, vel, 10000, ent, alt_fire ); missile->classname = "rocket_proj"; missile->s.weapon = WP_ROCKET_LAUNCHER; @@ -2010,7 +2010,7 @@ static void WP_FireRocket( gentity_t *ent, qboolean alt_fire ) } } - VectorCopy( forward, missile->movedir ); + VectorCopy( _forward, missile->movedir ); missile->e_ThinkFunc = thinkF_rocketThink; missile->random = 1.0f; @@ -2080,15 +2080,15 @@ static void WP_DropDetPack( gentity_t *self, vec3_t start, vec3_t dir ) //--------------------------------------------------------- { // Chucking a new one - AngleVectors( self->client->ps.viewangles, forward, vright, up ); - CalcMuzzlePoint( self, forward, vright, up, muzzle, 0 ); - VectorNormalize( forward ); - VectorMA( muzzle, -4, forward, muzzle ); + AngleVectors( self->client->ps.viewangles, _forward, vright, up ); + CalcMuzzlePoint( self, _forward, vright, up, muzzle, 0 ); + VectorNormalize( _forward ); + VectorMA( muzzle, -4, _forward, muzzle ); VectorCopy( muzzle, start ); WP_TraceSetStart( self, start, vec3_origin, vec3_origin );//make sure our start point isn't on the other side of a wall - gentity_t *missile = CreateMissile( start, forward, 300, 10000, self, qfalse ); + gentity_t *missile = CreateMissile( start, _forward, 300, 10000, self, qfalse ); missile->fxID = G_EffectIndex( "detpack/explosion" ); // if we set an explosion effect, explode death can use that instead @@ -2156,7 +2156,7 @@ static void WP_FireDetPack( gentity_t *ent, qboolean alt_fire ) } else { - WP_DropDetPack( ent, muzzle, forward ); + WP_DropDetPack( ent, muzzle, _forward ); ent->client->ps.eFlags |= EF_PLANTED_CHARGE; } @@ -2439,7 +2439,7 @@ void WP_PlaceLaserTrap( gentity_t *ent, qboolean alt_fire ) laserTrap->s.eFlags |= EF_MISSILE_STICK; laserTrap->s.pos.trType = TR_GRAVITY; - VectorScale( forward, LT_VELOCITY, laserTrap->s.pos.trDelta ); + VectorScale( _forward, LT_VELOCITY, laserTrap->s.pos.trDelta ); if ( alt_fire ) { @@ -2701,7 +2701,7 @@ gentity_t *WP_FireThermalDetonator( gentity_t *ent, qboolean alt_fire ) vec3_t dir, start; float damageScale = 1.0f; - VectorCopy( forward, dir ); + VectorCopy( _forward, dir ); VectorCopy( muzzle, start ); bolt = G_Spawn(); @@ -2836,7 +2836,7 @@ gentity_t *WP_FireThermalDetonator( gentity_t *ent, qboolean alt_fire ) gentity_t *WP_DropThermal( gentity_t *ent ) //--------------------------------------------------------- { - AngleVectors( ent->client->ps.viewangles, forward, vright, up ); + AngleVectors( ent->client->ps.viewangles, _forward, vright, up ); CalcEntitySpot( ent, SPOT_WEAPON, muzzle ); return (WP_FireThermalDetonator( ent, qfalse )); } @@ -2847,7 +2847,7 @@ gentity_t *WP_DropThermal( gentity_t *ent ) void WP_BotLaser( gentity_t *ent ) //--------------------------------------------------------- { - gentity_t *missile = CreateMissile( muzzle, forward, BRYAR_PISTOL_VEL, 10000, ent ); + gentity_t *missile = CreateMissile( muzzle, _forward, BRYAR_PISTOL_VEL, 10000, ent ); missile->classname = "bryar_proj"; missile->s.weapon = WP_BRYAR_PISTOL; @@ -2867,7 +2867,7 @@ void WP_EmplacedFire( gentity_t *ent ) float damage = EMPLACED_DAMAGE * ( ent->NPC ? 0.1f : 1.0f ); float vel = EMPLACED_VEL * ( ent->NPC ? 0.4f : 1.0f ); - gentity_t *missile = CreateMissile( muzzle, forward, vel, 10000, ent ); + gentity_t *missile = CreateMissile( muzzle, _forward, vel, 10000, ent ); missile->classname = "emplaced_proj"; missile->s.weapon = WP_EMPLACED_GUN; @@ -2905,7 +2905,7 @@ void WP_ATSTMainFire( gentity_t *ent ) vel *= 1.6f; } - gentity_t *missile = CreateMissile( muzzle, forward, vel, 10000, ent ); + gentity_t *missile = CreateMissile( muzzle, _forward, vel, 10000, ent ); missile->classname = "atst_main_proj"; missile->s.weapon = WP_ATST_MAIN; @@ -2935,7 +2935,7 @@ void WP_ATSTSideAltFire( gentity_t *ent ) vel = ATST_SIDE_ALT_VELOCITY; } - gentity_t *missile = CreateMissile( muzzle, forward, vel, 10000, ent, qtrue ); + gentity_t *missile = CreateMissile( muzzle, _forward, vel, 10000, ent, qtrue ); missile->classname = "atst_rocket"; missile->s.weapon = WP_ATST_SIDE; @@ -2959,7 +2959,7 @@ void WP_ATSTSideAltFire( gentity_t *ent ) } } - VectorCopy( forward, missile->movedir ); + VectorCopy( _forward, missile->movedir ); // Make it easier to hit things VectorSet( missile->maxs, ATST_SIDE_ALT_ROCKET_SIZE, ATST_SIDE_ALT_ROCKET_SIZE, ATST_SIDE_ALT_ROCKET_SIZE ); @@ -2986,7 +2986,7 @@ void WP_ATSTSideFire( gentity_t *ent ) { int damage = ATST_SIDE_MAIN_DAMAGE; - gentity_t *missile = CreateMissile( muzzle, forward, ATST_SIDE_MAIN_VELOCITY, 10000, ent, qfalse ); + gentity_t *missile = CreateMissile( muzzle, _forward, ATST_SIDE_MAIN_VELOCITY, 10000, ent, qfalse ); missile->classname = "atst_side_proj"; missile->s.weapon = WP_ATST_SIDE; @@ -3038,7 +3038,7 @@ void WP_FireStunBaton( gentity_t *ent, qboolean alt_fire ) VectorCopy( muzzle, start ); WP_TraceSetStart( ent, start, vec3_origin, vec3_origin ); - VectorMA( start, STUN_BATON_RANGE, forward, end ); + VectorMA( start, STUN_BATON_RANGE, _forward, end ); VectorSet( maxs, 5, 5, 5 ); VectorScale( maxs, -1, mins ); @@ -3060,11 +3060,11 @@ void WP_FireStunBaton( gentity_t *ent, qboolean alt_fire ) // G_Sound( tr_ent, G_SoundIndex( va("sound/weapons/melee/punch%d", Q_irand(1, 4)) ) ); tr_ent->client->ps.powerups[PW_SHOCKED] = level.time + 1500; - G_Damage( tr_ent, ent, ent, forward, tr.endpos, STUN_BATON_DAMAGE, DAMAGE_NO_KNOCKBACK, MOD_MELEE ); + G_Damage( tr_ent, ent, ent, _forward, tr.endpos, STUN_BATON_DAMAGE, DAMAGE_NO_KNOCKBACK, MOD_MELEE ); } else if ( tr_ent->svFlags & SVF_GLASS_BRUSH || ( tr_ent->svFlags & SVF_BBRUSH && tr_ent->material == 12 )) // material grate...we are breaking a grate! { - G_Damage( tr_ent, ent, ent, forward, tr.endpos, 999, DAMAGE_NO_KNOCKBACK, MOD_MELEE ); // smash that puppy + G_Damage( tr_ent, ent, ent, _forward, tr.endpos, 999, DAMAGE_NO_KNOCKBACK, MOD_MELEE ); // smash that puppy } } @@ -3079,7 +3079,7 @@ void WP_Melee( gentity_t *ent ) int damage = ent->s.number ? (g_spskill->integer*2)+1 : 3; float range = ent->s.number ? 64 : 32; - VectorMA( muzzle, range, forward, end ); + VectorMA( muzzle, range, _forward, end ); VectorSet( maxs, 6, 6, 6 ); VectorScale( maxs, -1, mins ); @@ -3108,7 +3108,7 @@ void WP_Melee( gentity_t *ent ) if ( tr_ent && tr_ent->takedamage ) { G_Sound( tr_ent, G_SoundIndex( va("sound/weapons/melee/punch%d", Q_irand(1, 4)) ) ); - G_Damage( tr_ent, ent, ent, forward, tr.endpos, damage, DAMAGE_NO_KNOCKBACK, MOD_MELEE ); + G_Damage( tr_ent, ent, ent, _forward, tr.endpos, damage, DAMAGE_NO_KNOCKBACK, MOD_MELEE ); } } @@ -3280,7 +3280,7 @@ qboolean LogAccuracyHit( gentity_t *target, gentity_t *attacker ) { } //--------------------------------------------------------- -void CalcMuzzlePoint( gentity_t *const ent, vec3_t forward, vec3_t right, vec3_t up, vec3_t muzzlePoint, float lead_in ) +void CalcMuzzlePoint( gentity_t *const ent, vec3_t _forward, vec3_t right, vec3_t up, vec3_t muzzlePoint, float lead_in ) //--------------------------------------------------------- { vec3_t org; @@ -3306,7 +3306,7 @@ void CalcMuzzlePoint( gentity_t *const ent, vec3_t forward, vec3_t right, vec3_t ViewHeightFix(ent); muzzlePoint[2] += ent->client->ps.viewheight;//By eyes muzzlePoint[2] -= 16; - VectorMA( muzzlePoint, 28, forward, muzzlePoint ); + VectorMA( muzzlePoint, 28, _forward, muzzlePoint ); VectorMA( muzzlePoint, 6, vright, muzzlePoint ); break; @@ -3322,9 +3322,9 @@ void CalcMuzzlePoint( gentity_t *const ent, vec3_t forward, vec3_t right, vec3_t muzzlePoint[2] += ent->client->ps.viewheight;//By eyes muzzlePoint[2] -= 1; if ( ent->s.number == 0 ) - VectorMA( muzzlePoint, 12, forward, muzzlePoint ); // player, don't set this any lower otherwise the projectile will impact immediately when your back is to a wall + VectorMA( muzzlePoint, 12, _forward, muzzlePoint ); // player, don't set this any lower otherwise the projectile will impact immediately when your back is to a wall else - VectorMA( muzzlePoint, 2, forward, muzzlePoint ); // NPC, don't set too far forward otherwise the projectile can go through doors + VectorMA( muzzlePoint, 2, _forward, muzzlePoint ); // NPC, don't set too far forward otherwise the projectile can go through doors VectorMA( muzzlePoint, 1, vright, muzzlePoint ); break; @@ -3341,7 +3341,7 @@ void CalcMuzzlePoint( gentity_t *const ent, vec3_t forward, vec3_t right, vec3_t { muzzlePoint[2] += 16; } - VectorMA( muzzlePoint, 8, forward, muzzlePoint ); + VectorMA( muzzlePoint, 8, _forward, muzzlePoint ); VectorMA( muzzlePoint, 16, vright, muzzlePoint ); break; @@ -3392,7 +3392,7 @@ void FireWeapon( gentity_t *ent, qboolean alt_fire ) if ( ent->NPC ) { //snipers must use the angles they actually did their shot trace with - AngleVectors( ent->lastAngles, forward, vright, up ); + AngleVectors( ent->lastAngles, _forward, vright, up ); } } else if ( ent->s.weapon == WP_ATST_SIDE || ent->s.weapon == WP_ATST_MAIN ) @@ -3451,12 +3451,12 @@ void FireWeapon( gentity_t *ent, qboolean alt_fire ) gi.G2API_GiveMeVectorFromMatrix( boltMatrix, NEGATIVE_Y, ent->client->renderInfo.muzzleDir ); ent->client->renderInfo.mPCalcTime = level.time; - AngleVectors( ent->client->ps.viewangles, forward, vright, up ); + AngleVectors( ent->client->ps.viewangles, _forward, vright, up ); //CalcMuzzlePoint( ent, forward, vright, up, muzzle, 0 ); } else if ( !ent->enemy ) {//an NPC with no enemy to auto-aim at - VectorCopy( ent->client->renderInfo.muzzleDir, forward ); + VectorCopy( ent->client->renderInfo.muzzleDir, _forward ); } else {//NPC, auto-aim at enemy @@ -3465,7 +3465,7 @@ void FireWeapon( gentity_t *ent, qboolean alt_fire ) VectorSubtract (enemy_org1, muzzle1, delta1); vectoangles ( delta1, angleToEnemy1 ); - AngleVectors (angleToEnemy1, forward, vright, up); + AngleVectors (angleToEnemy1, _forward, vright, up); } } else if ( ent->s.weapon == WP_BOT_LASER && ent->enemy ) @@ -3479,15 +3479,15 @@ void FireWeapon( gentity_t *ent, qboolean alt_fire ) VectorSubtract (enemy_org1, muzzle1, delta1); vectoangles ( delta1, angleToEnemy1 ); - AngleVectors (angleToEnemy1, forward, vright, up); + AngleVectors (angleToEnemy1, _forward, vright, up); } else { - AngleVectors( ent->client->ps.viewangles, forward, vright, up ); + AngleVectors( ent->client->ps.viewangles, _forward, vright, up ); } ent->alt_fire = alt_fire; - CalcMuzzlePoint ( ent, forward, vright, up, muzzle , 0); + CalcMuzzlePoint ( ent, _forward, vright, up, muzzle , 0); // fire the specific weapon switch( ent->s.weapon ) diff --git a/code/icarus/BlockStream.cpp b/code/icarus/BlockStream.cpp index 113ad71..de68f0b 100644 --- a/code/icarus/BlockStream.cpp +++ b/code/icarus/BlockStream.cpp @@ -329,7 +329,7 @@ CBlockMember *CBlock::GetMember( int memberNum ) { if ( memberNum > GetNumMembers()-1 ) { - return false; + return NULL; } return m_members[ memberNum ]; } @@ -363,7 +363,7 @@ CBlock *CBlock::Duplicate( void ) newblock = new CBlock; if ( newblock == NULL ) - return false; + return NULL; newblock->Create( m_id ); diff --git a/code/qcommon/common.cpp b/code/qcommon/common.cpp index d9e43d1..c1ce406 100644 --- a/code/qcommon/common.cpp +++ b/code/qcommon/common.cpp @@ -257,7 +257,9 @@ void QDECL Com_Error( int code, const char *fmt, ... ) { CL_Disconnect(); CL_FlushMemory(); CL_StartHunkUsers(); - Com_Printf (S_COLOR_RED"********************\n"S_COLOR_MAGENTA"ERROR: %s\n"S_COLOR_RED"********************\n", com_errorMessage); + Com_Printf(S_COLOR_RED"********************\n"); + Com_Printf(S_COLOR_MAGENTA"ERROR: %s\n", com_errorMessage); + Com_Printf(S_COLOR_RED"********************\n"); com_errorEntered = qfalse; throw ("DROPPED\n"); } else if ( code == ERR_NEED_CD ) { diff --git a/code/qcommon/msg.cpp b/code/qcommon/msg.cpp index 59004c6..fff75a0 100644 --- a/code/qcommon/msg.cpp +++ b/code/qcommon/msg.cpp @@ -482,7 +482,7 @@ entityState_t communication typedef struct { char *name; - int offset; + size_t offset; int bits; // 0 = float } netField_t; diff --git a/code/renderer/tr_shader.cpp b/code/renderer/tr_shader.cpp index 971e20e..206213e 100644 --- a/code/renderer/tr_shader.cpp +++ b/code/renderer/tr_shader.cpp @@ -1854,7 +1854,7 @@ void ParseSort( const char **text ) typedef struct { char *name; - int clearSolid, surfaceFlags, contents; + long long clearSolid, surfaceFlags, contents; } infoParm_t;