dlls: fix build

This commit is contained in:
Alibek Omarov 2020-09-01 19:30:02 +03:00
parent e3cfefbd5c
commit a9d98679f3
29 changed files with 82 additions and 64 deletions

View File

@ -550,7 +550,8 @@ float SetController( void *pmodel, byte *controller, int iController, float flVa
mstudiobonecontroller_t *pbonecontroller = (mstudiobonecontroller_t *)((byte *)pstudiohdr + pstudiohdr->bonecontrollerindex);
// find first controller that matches the index
for( int i = 0; i < pstudiohdr->numbonecontrollers; i++, pbonecontroller++ )
int i;
for( i = 0; i < pstudiohdr->numbonecontrollers; i++, pbonecontroller++ )
{
if( pbonecontroller->index == iController )
break;
@ -603,7 +604,8 @@ float GetControllerBound2( void *pmodel, int iController )
mstudiobonecontroller_t *pbonecontroller = (mstudiobonecontroller_t *)((byte *)pstudiohdr + pstudiohdr->bonecontrollerindex);
// find first controller that matches the index
for( int i = 0; i < pstudiohdr->numbonecontrollers; i++, pbonecontroller++ )
int i;
for( i = 0; i < pstudiohdr->numbonecontrollers; i++, pbonecontroller++ )
{
if( pbonecontroller->index == iController )
break;

View File

@ -323,9 +323,11 @@ void CEnvState::Think( void )
{
ALERT(at_debug,"DEBUG: env_state \"%s\" turned itself off",STRING(pev->targetname));
if (pev->target)
{
ALERT(at_debug,": firing %s",STRING(pev->target));
if (pev->noise2)
ALERT(at_debug," and %s",STRING(pev->noise2));
}
else if (pev->noise2)
ALERT(at_debug,": firing %s",STRING(pev->noise2));
ALERT(at_debug,".\n");

View File

@ -455,7 +455,7 @@ BOOL CBaseMonster :: HasHumanGibs( void )
// these types of monster don't use gibs
if ( myClass == CLASS_NONE || myClass == CLASS_MACHINE ||
myClass == CLASS_PLAYER_BIOWEAPON && myClass == CLASS_ALIEN_BIOWEAPON)
(myClass == CLASS_PLAYER_BIOWEAPON && myClass == CLASS_ALIEN_BIOWEAPON))
{
return FALSE;
}
@ -472,7 +472,7 @@ BOOL CBaseMonster :: HasAlienGibs( void )
// these types of monster don't use gibs
if ( myClass == CLASS_NONE || myClass == CLASS_MACHINE ||
myClass == CLASS_PLAYER_BIOWEAPON && myClass == CLASS_ALIEN_BIOWEAPON)
(myClass == CLASS_PLAYER_BIOWEAPON && myClass == CLASS_ALIEN_BIOWEAPON))
{
return FALSE;
}
@ -505,7 +505,7 @@ void CBaseMonster :: GibMonster( void )
EMIT_SOUND(ENT(pev), CHAN_WEAPON, "common/bodysplat.wav", 1, ATTN_NORM);
if ( iszCustomGibs = HasCustomGibs() ) //LRC - monster_generic can have a custom gibset
if ( (iszCustomGibs = HasCustomGibs()) ) //LRC - monster_generic can have a custom gibset
{
if ( CVAR_GET_FLOAT("violence_hgibs") != 0 )
{

View File

@ -392,7 +392,7 @@ void CBaseDoor::Spawn( )
SetTouch ( NULL );
}
else // touchable button
SetTouch( DoorTouch );
SetTouch( &CBaseDoor::DoorTouch );
}
//END
@ -965,7 +965,7 @@ void CBaseDoor::Blocked( CBaseEntity *pOther )
if ( !pTarget )
break;
if ( VARS( pTarget->pev ) != pev && FClassnameIs ( pTarget->pev, "func_door" ) ||
if ( ( VARS( pTarget->pev ) != pev && FClassnameIs ( pTarget->pev, "func_door" )) ||
FClassnameIs ( pTarget->pev, "func_door_rotating" ) )
{
pDoor = GetClassPtr( (CBaseDoor *) VARS(pTarget->pev) );

View File

@ -3939,7 +3939,7 @@ void CEnvDLight::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE us
{
if (pev->spawnflags & SF_DLIGHT_ONLYONCE)
{
SetThink( SUB_Remove );
SetThink( &CEnvDLight::SUB_Remove );
SetNextThink( 0 );
}
}
@ -3973,7 +3973,7 @@ void CEnvDLight::Think( void )
if (pev->spawnflags & SF_DLIGHT_ONLYONCE)
{
SetThink( SUB_Remove );
SetThink( &CEnvDLight::SUB_Remove );
SetNextThink( 0 );
}
}
@ -4680,7 +4680,8 @@ public:
if( pev->skin <= 0 || pev->skin > 6 )
{
// try all directions
for( int i = 0; i < 6; i++ )
int i;
for( i = 0; i < 6; i++ )
if( PasteDecal( i )) break;
if( i == 6 ) ALERT( at_warning, "failed to place decal %s\n", STRING( pev->netname ));
}
@ -4871,12 +4872,12 @@ public:
}
else if( pev->sequence )
{
SetThink( CineThink );
SetThink( &CDynamicLight::CineThink );
SetNextThink( 0.1f );
}
else if( pev->scale )
{
SetThink( PVSThink );
SetThink( &CDynamicLight::PVSThink );
SetNextThink( 0.1f );
}
}
@ -4924,12 +4925,12 @@ public:
}
else if( pev->sequence )
{
SetThink( CineThink );
SetThink( &CDynamicLight::CineThink );
SetNextThink( 0.1f );
}
else if( pev->scale )
{
SetThink( PVSThink );
SetThink( &CDynamicLight::PVSThink );
SetNextThink( 0.1f );
}
}
@ -5034,7 +5035,7 @@ void CFuncScreenMovie :: Spawn( void )
// enable monitor
if( FBitSet( pev->spawnflags, SF_SCREENMOVIE_START_ON ))
{
SetThink( SUB_CallUseToggle );
SetThink( &CFuncScreenMovie::SUB_CallUseToggle );
SetNextThink( 0.1 );
}
}
@ -5047,7 +5048,7 @@ void CFuncScreenMovie :: Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE
return;
}
SetThink( CineThink );
SetThink( &CFuncScreenMovie::CineThink );
if( ShouldToggle( useType ))
{

View File

@ -45,7 +45,6 @@
//typedef unsigned long ULONG;
typedef unsigned char BYTE;
typedef int BOOL;
#define MAX_PATH PATH_MAX
#include <limits.h>
#include <stdarg.h>
#ifndef min

View File

@ -60,7 +60,7 @@ public:
virtual int Save( CSave &save );
virtual int Restore( CRestore &restore );
static TYPEDESCRIPTION m_SaveData[];
BOOL CFuncTankControls :: OnControls( entvars_t *pevTest );
BOOL OnControls( entvars_t *pevTest );
BOOL m_active; // am I being used to control tanks right now?
Vector m_vecControllerUsePos; // where was the player standing when he used me?
@ -234,7 +234,7 @@ protected:
int m_iTankClass; // Behave As
void CFuncTank::UpdateSpot( void );
void UpdateSpot( void );
// CLaserSpot* m_pViewTarg; // Player view indicator
CPointEntity *m_pFireProxy; //LRC - locus position for custom shots
@ -1595,7 +1595,7 @@ void CFuncTankControls :: Use( CBaseEntity *pActivator, CBaseEntity *pCaller, US
return;
//LRC- Now uses FindEntityByTargetname, so that aliases work.
while (tryTank = UTIL_FindEntityByTargetname(tryTank, STRING(pev->target)))
while ((tryTank = UTIL_FindEntityByTargetname(tryTank, STRING(pev->target))))
{
if (!strncmp( STRING(tryTank->pev->classname), "func_tank", 9 ))
{
@ -1635,7 +1635,7 @@ void CFuncTankControls :: Use( CBaseEntity *pActivator, CBaseEntity *pCaller, US
//ALERT(at_console, "TANK controls deactivated\n");
//LRC- Now uses FindEntityByTargetname, so that aliases work.
while (tryTank = UTIL_FindEntityByTargetname(tryTank, STRING(pev->target)))
while ((tryTank = UTIL_FindEntityByTargetname(tryTank, STRING(pev->target))))
{
if (FClassnameIs(tryTank->pev, "func_tank") || FClassnameIs(tryTank->pev, "func_tanklaser") || FClassnameIs(tryTank->pev, "func_tankmortar") || FClassnameIs(tryTank->pev, "func_tankrocket"))
{

View File

@ -355,7 +355,7 @@ void CHGrunt :: SpeakSentence( void )
int CHGrunt::IRelationship ( CBaseEntity *pTarget )
{
//LRC- only hate alien grunts if my behaviour hasn't been overridden
if (!m_iClass && FClassnameIs( pTarget->pev, "monster_alien_grunt" ) || ( FClassnameIs( pTarget->pev, "monster_gargantua" ) ) )
if ((!m_iClass && FClassnameIs( pTarget->pev, "monster_alien_grunt" )) || ( FClassnameIs( pTarget->pev, "monster_gargantua" ) ) )
{
return R_NM;
}

View File

@ -97,7 +97,7 @@ public:
BOOL FValidateHintType ( short sHint );
BOOL FCanActiveIdle ( void );
Schedule_t *GetScheduleOfType ( int Type );
Schedule_t *CHoundeye :: GetSchedule( void );
Schedule_t *GetSchedule( void );
int Save( CSave &save );
int Restore( CRestore &restore );

View File

@ -55,7 +55,7 @@ public:
{
pev->effects &= ~EF_NODRAW;
SetThink( PVSThink );
SetThink( &CFlashlight::PVSThink );
SetNextThink( 0.1f );
}

View File

@ -112,7 +112,7 @@ void COfficerBlood::Shoot( entvars_t *pevOwner, Vector vecStart, Vector vecVeloc
pBlood->pev->gravity = 1000;
pBlood->pev->owner = ENT(pevOwner);
pBlood->SetThink ( Animate );
pBlood->SetThink ( &COfficerBlood::Animate );
pBlood->pev->nextthink = gpGlobals->time + 0.1;
}
@ -162,7 +162,7 @@ void COfficerBlood :: Touch ( CBaseEntity *pOther )
pOther->TakeDamage ( pev, pev, gSkillData.superofficerDmgBlood, DMG_GENERIC );
}
SetThink ( SUB_Remove );
SetThink ( &COfficerBlood::SUB_Remove );
pev->nextthink = gpGlobals->time;
}

View File

@ -2754,7 +2754,7 @@ void CBaseMonster :: UpdateYaw( int yawSpeed )
{
float ideal, current, newYaw;
if( yawSpeed = -1 )
if( yawSpeed == -1 )
yawSpeed = pev->yaw_speed;
// NOTE: GetIdealYaw() will never exactly be reached because UTIL_AngleMod

View File

@ -546,7 +546,7 @@ void CHalfLifeMultiplay :: PlayerSpawn( CBasePlayer *pPlayer )
addDefault = TRUE;
while ( pWeaponEntity = UTIL_FindEntityByClassname( pWeaponEntity, "game_player_equip" ))
while (( pWeaponEntity = UTIL_FindEntityByClassname( pWeaponEntity, "game_player_equip" )))
{
pWeaponEntity->Touch( pPlayer );
addDefault = FALSE;

View File

@ -2428,7 +2428,7 @@ void CFuncTrackChange :: UpdateTrain( Vector &dest )
float time;
Vector vel = pev->velocity;
if (m_pfnThink == LinearMoveNow)
if (m_pfnThink == &CFuncTrackChange::LinearMoveNow)
{
// we're going to do a LinearMoveNow: calculate the velocity it'll have
Vector vecDest;

View File

@ -5753,7 +5753,7 @@ void CBasePlayer::SetJumpHeight(int value)
{
m_iJumpHeight = value;
char buf[16];
itoa(m_iJumpHeight, buf, 10);
Q_snprintf(buf, sizeof(buf), "%d", m_iJumpHeight);
g_engfuncs.pfnSetPhysicsKeyValue( edict(), "jh", buf );
// ALERT(at_aiconsole, "SETTING JUMP: %s\n", buf);
}

View File

@ -132,7 +132,7 @@ void CPropExplosion :: Spawn( void )
pev->nextthink = gpGlobals->time + 0.1;
// SetTouch( PropTouch ); //maybe later
SetThink( PropThink );
SetThink( &CPropExplosion::PropThink );
//If not defined, add standart value
if(!m_startHealth )

View File

@ -64,7 +64,7 @@ public:
void WritePositionVector( const char *pname, const float *value, int count ); // array of pos vectors
void WriteFunction( const char *pname, const int *value, int count ); // Save a function pointer
// Save a function pointer. (LRC- also pass the classname to allow better error messages)
void WriteFunction( const char* cname, const char *pname, const int *value, int count );
void WriteFunction( const char* cname, const char *pname, void **value, int count );
int WriteEntVars( const char *pname, entvars_t *pev ); // Save entvars_t (entvars_t)
int WriteFields( const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount );

View File

@ -1060,7 +1060,7 @@ MONSTERSTATE CScientist :: GetIdealState ( void )
if ( IsFollowing() )
{
int relationship = IRelationship( m_hEnemy );
if ( relationship != R_FR || relationship != R_HT && !HasConditions( bits_COND_LIGHT_DAMAGE | bits_COND_HEAVY_DAMAGE ) )
if ( relationship != R_FR || ( relationship != R_HT && !HasConditions( bits_COND_LIGHT_DAMAGE | bits_COND_HEAVY_DAMAGE ) ))
{
// Don't go to combat if you're following the player
m_IdealMonsterState = MONSTERSTATE_ALERT;

View File

@ -187,7 +187,7 @@ void CHalfLifeRules :: PlayerSpawn( CBasePlayer *pPlayer )
// LRC what's wrong with allowing "game_player_equip" entities in single player? (The
// level designer is God: if he wants the player to start with a weapon, we should allow it!)
while ( pWeaponEntity = UTIL_FindEntityByClassname( pWeaponEntity, "game_player_equip" ))
while (( pWeaponEntity = UTIL_FindEntityByClassname( pWeaponEntity, "game_player_equip" )))
{
pWeaponEntity->Touch( pPlayer );
}

View File

@ -221,7 +221,7 @@ void CSqueakGrenade::HuntThink( void )
pev->velocity = pev->velocity * 0.9;
pev->velocity.z += 8.0;
}
else if (pev->movetype = MOVETYPE_FLY)
else if (pev->movetype == MOVETYPE_FLY)
{
pev->movetype = MOVETYPE_BOUNCE;
}

View File

@ -108,7 +108,7 @@ void UpdateStats( CBasePlayer *pPlayer )
float ammo = 0;
for (i = 1; i < MAX_AMMO_SLOTS; i++)
{
ammo += ammoCount[i] * AmmoDamage( CBasePlayerItem::AmmoInfoArray[i].pszName );
ammo += ammoCount[i] * AmmoDamage( CBasePlayerAmmo::AmmoInfoArray[i].pszName );
}
float health = pPlayer->pev->health + pPlayer->pev->armorvalue * 2; // Armor is 2X health

View File

@ -673,7 +673,7 @@ CBaseEntity *CTalkMonster::EnumFriends( CBaseEntity *pPrevious, int listNumber,
Vector vecCheck;
pszFriend = m_szFriends[ FriendNumber(listNumber) ];
while (pFriend = UTIL_FindEntityByClassname( pFriend, pszFriend ))
while ((pFriend = UTIL_FindEntityByClassname( pFriend, pszFriend )))
{
if (pFriend == this || !pFriend->IsAlive())
// don't talk to self or dead people
@ -706,7 +706,7 @@ void CTalkMonster::AlertFriends( void )
// for each friend in this bsp...
for ( i = 0; i < TLK_CFRIENDS; i++ )
{
while (pFriend = EnumFriends( pFriend, i, TRUE ))
while ((pFriend = EnumFriends( pFriend, i, TRUE )))
{
CBaseMonster *pMonster = pFriend->MyMonsterPointer();
if ( pMonster->IsAlive() )
@ -728,7 +728,7 @@ void CTalkMonster::ShutUpFriends( void )
// for each friend in this bsp...
for ( i = 0; i < TLK_CFRIENDS; i++ )
{
while (pFriend = EnumFriends( pFriend, i, TRUE ))
while ((pFriend = EnumFriends( pFriend, i, TRUE )))
{
CBaseMonster *pMonster = pFriend->MyMonsterPointer();
if ( pMonster )
@ -751,7 +751,7 @@ void CTalkMonster::LimitFollowers( CBaseEntity *pPlayer, int maxFollowers )
// for each friend in this bsp...
for ( i = 0; i < TLK_CFRIENDS; i++ )
{
while (pFriend = EnumFriends( pFriend, i, FALSE ))
while ((pFriend = EnumFriends( pFriend, i, FALSE )))
{
CBaseMonster *pMonster = pFriend->MyMonsterPointer();
if ( pMonster )
@ -909,7 +909,7 @@ CBaseEntity *CTalkMonster :: FindNearestFriend(BOOL fPlayer)
continue;
// for each friend in this bsp...
while (pFriend = UTIL_FindEntityByClassname( pFriend, pszFriend ))
while ((pFriend = UTIL_FindEntityByClassname( pFriend, pszFriend )))
{
if (pFriend == this || !pFriend->IsAlive())
// don't talk to self or dead people

View File

@ -431,7 +431,7 @@ Vector UTIL_YawToVector( float yaw )
//LRC - pass in a normalised axis vector and a number of degrees, and this returns the corresponding
// angles value for an entity.
inline Vector UTIL_AxisRotationToAngles( const Vector &vecAxis, float flDegs )
Vector UTIL_AxisRotationToAngles( const Vector &vecAxis, float flDegs )
{
Vector vecTemp = UTIL_AxisRotationToVec( vecAxis, flDegs );
float rgflVecOut[3];
@ -2601,7 +2601,7 @@ void CSave :: WritePositionVector( const char *pname, const float *value, int co
}
void CSave :: WriteFunction( const char* cname, const char *pname, const int *data, int count )
void CSave :: WriteFunction( const char* cname, const char *pname, void **data, int count )
{
const char *functionName;
@ -2774,7 +2774,7 @@ int CSave :: WriteFields( const char *cname, const char *pname, void *pBaseData,
break;
case FIELD_FUNCTION:
WriteFunction( cname, pTest->fieldName, (int *)(char *)pOutputData, pTest->fieldSize );
WriteFunction( cname, pTest->fieldName, (void **)pOutputData, pTest->fieldSize );
break;
default:
ALERT( at_error, "Bad field type\n" );
@ -2995,12 +2995,11 @@ int CRestore::ReadField( void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCou
*((int *)pOutputData) = *( int *)pInputData;
break;
case FIELD_FUNCTION:
if ( strlen( (char *)pInputData ) == 0 )
*((int *)pOutputData) = 0;
if( ( (char *)pInputData )[0] == '\0' )
*( (void**)pOutputData ) = 0;
else
*((int *)pOutputData) = FUNCTION_FROM_NAME( (char *)pInputData );
break;
*( (void**)pOutputData ) = (void*)FUNCTION_FROM_NAME( (char *)pInputData );
break;
default:
ALERT( at_error, "Bad field type\n" );
}

View File

@ -429,8 +429,8 @@ void CBasePlayerItem :: Spawn( void )
UTIL_SetSize( pev, g_vecZero, g_vecZero ); // pointsize until it lands on the ground.
if( !FBitSet( ObjectCaps(), FCAP_USE_ONLY ) || FBitSet( pev->spawnflags, SF_NORESPAWN ))
SetTouch( DefaultTouch );
SetThink( FallThink );
SetTouch( &CBasePlayerItem::DefaultTouch );
SetThink( &CBasePlayerItem::FallThink );
SET_MODEL( edict(), STRING( iWorldModel( )));
@ -1514,7 +1514,7 @@ BOOL CBasePlayerItem :: DefaultHolster( Activity sequence, bool force )
ClearBits( m_pPlayer->pev->weapons, BIT( m_iId ));
m_pPlayer->pev->viewmodel = iStringNull;
m_pPlayer->pev->weaponmodel = iStringNull;
SetThink( DestroyItem );
SetThink( &CBasePlayerItem::DestroyItem );
SetNextThink( 0.5 );
}

View File

@ -23,7 +23,15 @@ def configure(conf):
def build(bld):
source = bld.path.parent.ant_glob([
'pm_shared/*.cpp',
'game_shared/*.cpp'
'game_shared/bone_setup.cpp',
'game_shared/common.cpp',
'game_shared/ikcontext.cpp',
'game_shared/material.cpp',
'game_shared/mathlib.cpp',
'game_shared/matrix.cpp',
'game_shared/stringlib.cpp',
'game_shared/virtualfs.cpp',
'game_shared/voice_gamemgr.cpp',
])
source += bld.path.ant_glob([
'*.cpp'

View File

@ -350,6 +350,7 @@ typedef enum _fieldtypes
FIELD_TIME, // a floating point time (these are fixed up automatically too!)
FIELD_MODELNAME, // Engine string that is a model name (needs precache)
FIELD_SOUNDNAME, // Engine string that is a sound name (needs precache)
FIELD_RANGE, // Min and Max range for generate random value
FIELD_TYPECOUNT // MUST BE LAST
} FIELDTYPE;

View File

@ -25,12 +25,14 @@ public:
RandomRange() { m_flMin = m_flMax = 0; m_bDefined = false; }
RandomRange( float fValue ) { m_flMin = m_flMax = fValue; m_bDefined = true; }
RandomRange( float fMin, float fMax) { m_flMin = fMin; m_flMax = fMax; m_bDefined = true; }
RandomRange( char *szToken )
RandomRange( const char *szToken )
{
char *mutableToken = new char[Q_strlen(szToken)];
strcpy(mutableToken, szToken);
char *cOneDot = NULL;
m_bDefined = true;
for( char *c = szToken; *c; c++ )
for( char *c = mutableToken; *c; c++ )
{
if( *c == '.' )
{
@ -49,6 +51,8 @@ public:
else cOneDot = NULL;
}
delete[] mutableToken;
// no range, just record the number
m_flMax = m_flMin = Q_atof( szToken );
}

View File

@ -179,6 +179,8 @@ def configure(conf):
'-Werror=bool-compare',
'-Werror=bool-operation',
'-Wstrict-aliasing',
'-Wno-conversion-null',
'-Wno-write-strings'
]
c_compiler_optional_flags = [