diff --git a/dlls/animation.cpp b/dlls/animation.cpp index 5d1ba17..da1755b 100644 --- a/dlls/animation.cpp +++ b/dlls/animation.cpp @@ -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; @@ -792,4 +794,4 @@ float SequenceDuration( void *pmodel, float poseparams[], int iSequence ) g_boneSetup.SetStudioPointers( pstudiohdr, poseparams ); return g_boneSetup.LocalDuration( iSequence ); -} \ No newline at end of file +} diff --git a/dlls/buttons.cpp b/dlls/buttons.cpp index 883ebb1..5f9f6e2 100644 --- a/dlls/buttons.cpp +++ b/dlls/buttons.cpp @@ -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"); diff --git a/dlls/combat.cpp b/dlls/combat.cpp index ef59536..f678e43 100644 --- a/dlls/combat.cpp +++ b/dlls/combat.cpp @@ -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 ) { diff --git a/dlls/doors.cpp b/dlls/doors.cpp index 0df38ba..50caf5d 100644 --- a/dlls/doors.cpp +++ b/dlls/doors.cpp @@ -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) ); diff --git a/dlls/effects.cpp b/dlls/effects.cpp index 3c0e188..9eb0e6f 100644 --- a/dlls/effects.cpp +++ b/dlls/effects.cpp @@ -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 )) { diff --git a/dlls/extdll.h b/dlls/extdll.h index 00dcea8..0af0331 100644 --- a/dlls/extdll.h +++ b/dlls/extdll.h @@ -45,7 +45,6 @@ //typedef unsigned long ULONG; typedef unsigned char BYTE; typedef int BOOL; -#define MAX_PATH PATH_MAX #include #include #ifndef min diff --git a/dlls/func_tank.cpp b/dlls/func_tank.cpp index 2cb608a..3a41888 100644 --- a/dlls/func_tank.cpp +++ b/dlls/func_tank.cpp @@ -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")) { diff --git a/dlls/hgrunt.cpp b/dlls/hgrunt.cpp index 64f9950..3690be6 100644 --- a/dlls/hgrunt.cpp +++ b/dlls/hgrunt.cpp @@ -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; } diff --git a/dlls/houndeye.cpp b/dlls/houndeye.cpp index 2240a16..7e34055 100644 --- a/dlls/houndeye.cpp +++ b/dlls/houndeye.cpp @@ -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 ); diff --git a/dlls/monster_head_controller.h b/dlls/monster_head_controller.h index 8030603..2030507 100644 --- a/dlls/monster_head_controller.h +++ b/dlls/monster_head_controller.h @@ -55,7 +55,7 @@ public: { pev->effects &= ~EF_NODRAW; - SetThink( PVSThink ); + SetThink( &CFlashlight::PVSThink ); SetNextThink( 0.1f ); } @@ -166,4 +166,4 @@ public: int m_iBackwardLen; EHANDLE m_hOwner; }; -#endif \ No newline at end of file +#endif diff --git a/dlls/monster_superofficer.cpp b/dlls/monster_superofficer.cpp index b9025f9..39269c7 100644 --- a/dlls/monster_superofficer.cpp +++ b/dlls/monster_superofficer.cpp @@ -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; } diff --git a/dlls/monsters.cpp b/dlls/monsters.cpp index 0e10d7d..befc09d 100644 --- a/dlls/monsters.cpp +++ b/dlls/monsters.cpp @@ -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 @@ -4004,4 +4004,4 @@ void CTargetMonster::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP else pev->health = 1; } -} \ No newline at end of file +} diff --git a/dlls/multiplay_gamerules.cpp b/dlls/multiplay_gamerules.cpp index 5960fbe..ccad860 100644 --- a/dlls/multiplay_gamerules.cpp +++ b/dlls/multiplay_gamerules.cpp @@ -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; diff --git a/dlls/plats.cpp b/dlls/plats.cpp index 2979455..aa663d9 100644 --- a/dlls/plats.cpp +++ b/dlls/plats.cpp @@ -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; diff --git a/dlls/player.cpp b/dlls/player.cpp index da9903f..19fa948 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -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); } @@ -5831,4 +5831,4 @@ void CBasePlayer::ViewPunch( float p, float y, float r ) pev->fuser2 -= p * 20; pev->fuser3 += y * 20; pev->fuser4 += r * 20; -} \ No newline at end of file +} diff --git a/dlls/prop_explosion.cpp b/dlls/prop_explosion.cpp index 688afde..1b32007 100644 --- a/dlls/prop_explosion.cpp +++ b/dlls/prop_explosion.cpp @@ -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 ) @@ -267,4 +267,4 @@ float CPropExplosion::CalculationSpriteScale( ) */ return Averagescale; -} \ No newline at end of file +} diff --git a/dlls/saverestore.h b/dlls/saverestore.h index 81b674b..fe12220 100644 --- a/dlls/saverestore.h +++ b/dlls/saverestore.h @@ -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 ); diff --git a/dlls/scientist.cpp b/dlls/scientist.cpp index 596dd98..4a4c894 100644 --- a/dlls/scientist.cpp +++ b/dlls/scientist.cpp @@ -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; diff --git a/dlls/singleplay_gamerules.cpp b/dlls/singleplay_gamerules.cpp index 7eab71d..c9aac25 100644 --- a/dlls/singleplay_gamerules.cpp +++ b/dlls/singleplay_gamerules.cpp @@ -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 ); } diff --git a/dlls/squeakgrenade.cpp b/dlls/squeakgrenade.cpp index 7dae4a7..9f5c029 100644 --- a/dlls/squeakgrenade.cpp +++ b/dlls/squeakgrenade.cpp @@ -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; } @@ -396,4 +396,4 @@ void CSqueakGrenade::SuperBounceTouch( CBaseEntity *pOther ) } m_flNextBounceSoundTime = gpGlobals->time + 0.5;// half second. -} \ No newline at end of file +} diff --git a/dlls/stats.cpp b/dlls/stats.cpp index 47dc3dd..6602b51 100644 --- a/dlls/stats.cpp +++ b/dlls/stats.cpp @@ -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 diff --git a/dlls/talkmonster.cpp b/dlls/talkmonster.cpp index 2c898ec..8cbab6f 100644 --- a/dlls/talkmonster.cpp +++ b/dlls/talkmonster.cpp @@ -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 diff --git a/dlls/func_physbox.cpp b/dlls/unused/func_physbox.cpp similarity index 100% rename from dlls/func_physbox.cpp rename to dlls/unused/func_physbox.cpp diff --git a/dlls/util.cpp b/dlls/util.cpp index 0b8bd59..61c6e32 100644 --- a/dlls/util.cpp +++ b/dlls/util.cpp @@ -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" ); } @@ -3258,4 +3257,4 @@ unsigned short UTIL_PrecacheMovie( const char *s, int allow_sound ) ALERT( at_console, "Warning: video (%s) not found!\n", path ); return 0; -} \ No newline at end of file +} diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index 1234cee..a52320a 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -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 ); } @@ -3066,4 +3066,4 @@ class CPainkiller : public CBasePlayerAmmo } }; -LINK_ENTITY_TO_CLASS( item_painkiller, CPainkiller ); \ No newline at end of file +LINK_ENTITY_TO_CLASS( item_painkiller, CPainkiller ); diff --git a/dlls/wscript b/dlls/wscript index b8f6e26..316072b 100644 --- a/dlls/wscript +++ b/dlls/wscript @@ -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' diff --git a/engine/eiface.h b/engine/eiface.h index 0da9e7f..68ff89a 100644 --- a/engine/eiface.h +++ b/engine/eiface.h @@ -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; diff --git a/game_shared/randomrange.h b/game_shared/randomrange.h index 05e5848..6157b39 100644 --- a/game_shared/randomrange.h +++ b/game_shared/randomrange.h @@ -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 == '.' ) { @@ -48,6 +50,8 @@ public: } else cOneDot = NULL; } + + delete[] mutableToken; // no range, just record the number m_flMax = m_flMin = Q_atof( szToken ); @@ -70,4 +74,4 @@ public: bool m_bDefined; }; -#endif//RANDOMRANGE_H \ No newline at end of file +#endif//RANDOMRANGE_H diff --git a/wscript b/wscript index 25f1dd7..2da24c0 100644 --- a/wscript +++ b/wscript @@ -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 = [