forked from valve/halflife-sdk
Next set of write-string fixes
This commit is contained in:
parent
584d1a597e
commit
23b1b76dce
22 changed files with 49 additions and 49 deletions
|
@ -52,7 +52,7 @@ int CBaseEntity :: IsDormant( void ) { return 0; }
|
|||
BOOL CBaseEntity :: IsInWorld( void ) { return TRUE; }
|
||||
int CBaseEntity::ShouldToggle( USE_TYPE useType, BOOL currentState ) { return 0; }
|
||||
int CBaseEntity :: DamageDecal( int bitsDamageType ) { return -1; }
|
||||
CBaseEntity * CBaseEntity::Create( char *szName, const Vector &vecOrigin, const Vector &vecAngles, edict_t *pentOwner ) { return NULL; }
|
||||
CBaseEntity * CBaseEntity::Create( const char *szName, const Vector &vecOrigin, const Vector &vecAngles, edict_t *pentOwner ) { return NULL; }
|
||||
void CBaseEntity::SUB_Remove( void ) { }
|
||||
|
||||
// CBaseDelay Stubs
|
||||
|
@ -77,7 +77,7 @@ void UTIL_MakeVectors( const Vector &vecAngles ) { }
|
|||
BOOL UTIL_IsValidEntity( edict_t *pent ) { return TRUE; }
|
||||
void UTIL_SetOrigin( entvars_t *, const Vector &org ) { }
|
||||
BOOL UTIL_GetNextBestWeapon( CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon ) { return TRUE; }
|
||||
void UTIL_LogPrintf(char *,...) { }
|
||||
void UTIL_LogPrintf(const char *,...) { }
|
||||
void UTIL_ClientPrintAll( int,char const *,char const *,char const *,char const *,char const *) { }
|
||||
void ClientPrint( entvars_t *client, int msg_dest, const char *msg_name, const char *param1, const char *param2, const char *param3, const char *param4 ) { }
|
||||
|
||||
|
@ -291,7 +291,7 @@ BOOL CBasePlayer::HasPlayerItem( CBasePlayerItem *pCheckItem ) { return FALSE; }
|
|||
BOOL CBasePlayer :: SwitchWeapon( CBasePlayerItem *pWeapon ) { return FALSE; }
|
||||
Vector CBasePlayer :: GetGunPosition( void ) { return g_vecZero; }
|
||||
const char *CBasePlayer::TeamID( void ) { return ""; }
|
||||
int CBasePlayer :: GiveAmmo( int iCount, char *szName, int iMax ) { return 0; }
|
||||
int CBasePlayer :: GiveAmmo( int iCount, const char *szName, int iMax ) { return 0; }
|
||||
void CBasePlayer::AddPoints( int score, BOOL bAllowNegativeScore ) { }
|
||||
void CBasePlayer::AddPointsToTeam( int score, BOOL bAllowNegativeScore ) { }
|
||||
|
||||
|
|
|
@ -965,7 +965,7 @@ public:
|
|||
float m_flFuseTimer; // How long does the fuse last on this explosive?
|
||||
float m_flDamage; // How much damage do our explosives dish out ?
|
||||
float m_flResistance; // Air resistance
|
||||
char *m_pszExplosiveModel; // What does our explosive look like ?
|
||||
const char *m_pszExplosiveModel; // What does our explosive look like ?
|
||||
BOOL m_bFusePrimed; // TRUE if the bomb we are holding is ticking!
|
||||
int m_iExplosiveType; // Explosive class to use
|
||||
|
||||
|
|
|
@ -352,8 +352,8 @@ enum e_weapcategory {
|
|||
|
||||
typedef struct playeritem_s
|
||||
{
|
||||
char *weapon_classname;
|
||||
char *ammo_classname;
|
||||
const char *weapon_classname;
|
||||
const char *ammo_classname;
|
||||
int num_ammospawns;
|
||||
int category;
|
||||
} playeritem_t;
|
||||
|
|
|
@ -100,7 +100,7 @@ typedef enum {
|
|||
|
||||
typedef struct {
|
||||
int type;
|
||||
char *name;
|
||||
const char *name;
|
||||
} activity_map_t;
|
||||
|
||||
extern activity_map_t activity_map[];
|
||||
|
|
|
@ -288,7 +288,7 @@ IMPLEMENT_SAVERESTORE( CBaseButton, CBaseToggle );
|
|||
|
||||
void CBaseButton::Precache( void )
|
||||
{
|
||||
char *pszSound;
|
||||
const char *pszSound;
|
||||
|
||||
if ( FBitSet ( pev->spawnflags, SF_BUTTON_SPARK_IF_OFF ) )// this button should spark in OFF state
|
||||
{
|
||||
|
@ -441,7 +441,7 @@ LINK_ENTITY_TO_CLASS( func_button, CBaseButton );
|
|||
|
||||
void CBaseButton::Spawn( )
|
||||
{
|
||||
char *pszSound;
|
||||
const char *pszSound;
|
||||
|
||||
//----------------------------------------------------
|
||||
//determine sounds for buttons
|
||||
|
@ -508,9 +508,9 @@ void CBaseButton::Spawn( )
|
|||
// Button sound table.
|
||||
// Also used by CBaseDoor to get 'touched' door lock/unlock sounds
|
||||
|
||||
char *ButtonSound( int sound )
|
||||
const char *ButtonSound( int sound )
|
||||
{
|
||||
char *pszSound;
|
||||
const char *pszSound;
|
||||
|
||||
switch ( sound )
|
||||
{
|
||||
|
@ -809,7 +809,7 @@ LINK_ENTITY_TO_CLASS( func_rot_button, CRotButton );
|
|||
|
||||
void CRotButton::Spawn( void )
|
||||
{
|
||||
char *pszSound;
|
||||
const char *pszSound;
|
||||
//----------------------------------------------------
|
||||
//determine sounds for buttons
|
||||
//a sound of 0 should not make a sound
|
||||
|
@ -951,7 +951,7 @@ void CMomentaryRotButton::Spawn( void )
|
|||
UTIL_SetOrigin(pev, pev->origin);
|
||||
SET_MODEL(ENT(pev), STRING(pev->model) );
|
||||
|
||||
char *pszSound = ButtonSound( m_sounds );
|
||||
const char *pszSound = ButtonSound( m_sounds );
|
||||
PRECACHE_SOUND(pszSound);
|
||||
pev->noise = ALLOC_STRING(pszSound);
|
||||
m_lastUsed = 0;
|
||||
|
|
|
@ -752,7 +752,7 @@ int CBaseEntity :: DamageDecal( int bitsDamageType )
|
|||
|
||||
// NOTE: szName must be a pointer to constant memory, e.g. "monster_class" because the entity
|
||||
// will keep a pointer to it after this call.
|
||||
CBaseEntity * CBaseEntity::Create( char *szName, const Vector &vecOrigin, const Vector &vecAngles, edict_t *pentOwner )
|
||||
CBaseEntity * CBaseEntity::Create( const char *szName, const Vector &vecOrigin, const Vector &vecAngles, edict_t *pentOwner )
|
||||
{
|
||||
edict_t *pent;
|
||||
CBaseEntity *pEntity;
|
||||
|
|
|
@ -176,7 +176,7 @@ public:
|
|||
virtual void AddPointsToTeam( int score, BOOL bAllowNegativeScore ) {}
|
||||
virtual BOOL AddPlayerItem( CBasePlayerItem *pItem ) { return 0; }
|
||||
virtual BOOL RemovePlayerItem( CBasePlayerItem *pItem ) { return 0; }
|
||||
virtual int GiveAmmo( int iAmount, char *szName, int iMax ) { return -1; };
|
||||
virtual int GiveAmmo( int iAmount, const char *szName, int iMax ) { return -1; };
|
||||
virtual float GetDelay( void ) { return 0; }
|
||||
virtual int IsMoving( void ) { return pev->velocity != g_vecZero; }
|
||||
virtual void OverrideReset( void ) {}
|
||||
|
@ -319,7 +319,7 @@ public:
|
|||
|
||||
|
||||
//
|
||||
static CBaseEntity *Create( char *szName, const Vector &vecOrigin, const Vector &vecAngles, edict_t *pentOwner = NULL );
|
||||
static CBaseEntity *Create( const char *szName, const Vector &vecOrigin, const Vector &vecAngles, edict_t *pentOwner = NULL );
|
||||
|
||||
virtual BOOL FBecomeProne( void ) {return FALSE;};
|
||||
edict_t *edict() { return ENT( pev ); };
|
||||
|
@ -659,7 +659,7 @@ class CSound;
|
|||
#include "basemonster.h"
|
||||
|
||||
|
||||
char *ButtonSound( int sound ); // get string of button sound number
|
||||
const char *ButtonSound( int sound ); // get string of button sound number
|
||||
|
||||
|
||||
//
|
||||
|
|
|
@ -221,7 +221,7 @@ void ClientPutInServer( edict_t *pEntity )
|
|||
pPlayer->pev->effects |= EF_NOINTERP;
|
||||
}
|
||||
|
||||
void SendMsgTo(CBasePlayer *client,edict_t *pEntity, int teamonly,char text[128],char *classname)
|
||||
void SendMsgTo(CBasePlayer *client,edict_t *pEntity, int teamonly,char text[128],const char *classname)
|
||||
{
|
||||
client = NULL;
|
||||
|
||||
|
@ -360,7 +360,7 @@ void Host_Say( edict_t *pEntity, int teamonly )
|
|||
// echo to server console
|
||||
g_engfuncs.pfnServerPrint( text );
|
||||
|
||||
char * temp;
|
||||
const char * temp;
|
||||
if ( teamonly )
|
||||
temp = "say_team";
|
||||
else
|
||||
|
|
|
@ -66,7 +66,7 @@ enum decal_e
|
|||
|
||||
typedef struct
|
||||
{
|
||||
char *name;
|
||||
const char *name;
|
||||
int index;
|
||||
} DLL_DECALLIST;
|
||||
|
||||
|
|
|
@ -335,7 +335,7 @@ void CBaseDoor :: SetToggleState( int state )
|
|||
|
||||
void CBaseDoor::Precache( void )
|
||||
{
|
||||
char *pszSound;
|
||||
const char *pszSound;
|
||||
|
||||
// set the door's "in-motion" sound
|
||||
switch (m_bMoveSnd)
|
||||
|
|
|
@ -360,7 +360,7 @@ void CBreakable::DamageSound( void )
|
|||
{
|
||||
int pitch;
|
||||
float fvol;
|
||||
char *rgpsz[6];
|
||||
const char *rgpsz[6];
|
||||
int i;
|
||||
int material = m_Material;
|
||||
|
||||
|
@ -802,7 +802,7 @@ public:
|
|||
|
||||
static TYPEDESCRIPTION m_SaveData[];
|
||||
|
||||
static char *m_soundNames[3];
|
||||
static const char *m_soundNames[3];
|
||||
int m_lastSound; // no need to save/restore, just keeps the same sound from playing twice in a row
|
||||
float m_maxSpeed;
|
||||
float m_soundTime;
|
||||
|
@ -818,7 +818,7 @@ IMPLEMENT_SAVERESTORE( CPushable, CBreakable );
|
|||
|
||||
LINK_ENTITY_TO_CLASS( func_pushable, CPushable );
|
||||
|
||||
char *CPushable :: m_soundNames[3] = { "debris/pushbox1.wav", "debris/pushbox2.wav", "debris/pushbox3.wav" };
|
||||
const char *CPushable :: m_soundNames[3] = { "debris/pushbox1.wav", "debris/pushbox2.wav", "debris/pushbox3.wav" };
|
||||
|
||||
|
||||
void CPushable :: Spawn( void )
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
class CCycler : public CBaseMonster
|
||||
{
|
||||
public:
|
||||
void GenericCyclerSpawn(char *szModel, Vector vecMin, Vector vecMax);
|
||||
void GenericCyclerSpawn(const char *szModel, Vector vecMin, Vector vecMax);
|
||||
virtual int ObjectCaps( void ) { return (CBaseEntity :: ObjectCaps() | FCAP_IMPULSE_USE); }
|
||||
int TakeDamage( entvars_t* pevInflictor, entvars_t* pevAttacker, float flDamage, int bitsDamageType );
|
||||
void Spawn( void );
|
||||
|
@ -96,7 +96,7 @@ void CCyclerProbe :: Spawn( void )
|
|||
|
||||
// Cycler member functions
|
||||
|
||||
void CCycler :: GenericCyclerSpawn(char *szModel, Vector vecMin, Vector vecMax)
|
||||
void CCycler :: GenericCyclerSpawn(const char *szModel, Vector vecMin, Vector vecMax)
|
||||
{
|
||||
if (!szModel || !*szModel)
|
||||
{
|
||||
|
|
|
@ -291,8 +291,8 @@ void CPlayerInventory::SpawnInventory( CBasePlayer *pPlayer )
|
|||
if( index < 0 )
|
||||
continue;
|
||||
|
||||
char *weapon_classname = pList->array[index].weapon_classname;
|
||||
char *ammo_classname = pList->array[index].ammo_classname;
|
||||
const char *weapon_classname = pList->array[index].weapon_classname;
|
||||
const char *ammo_classname = pList->array[index].ammo_classname;
|
||||
int ammo_count = pList->array[index].num_ammospawns;
|
||||
|
||||
// Spawn ammo for weapon
|
||||
|
@ -3690,7 +3690,7 @@ int CBasePlayer::RemovePlayerItem( CBasePlayerItem *pItem )
|
|||
//
|
||||
// Returns the unique ID for the ammo, or -1 if error
|
||||
//
|
||||
int CBasePlayer :: GiveAmmo( int iCount, char *szName, int iMax )
|
||||
int CBasePlayer :: GiveAmmo( int iCount, const char *szName, int iMax )
|
||||
{
|
||||
if ( !szName )
|
||||
{
|
||||
|
|
|
@ -315,7 +315,7 @@ public:
|
|||
void GiveNamedItem( const char *szName );
|
||||
void EnableControl(BOOL fControl);
|
||||
|
||||
int GiveAmmo( int iAmount, char *szName, int iMax );
|
||||
int GiveAmmo( int iAmount, const char *szName, int iMax );
|
||||
void SendAmmoUpdate(void);
|
||||
|
||||
void WaterMove( void );
|
||||
|
|
|
@ -1618,7 +1618,7 @@ float TEXTURETYPE_PlaySound(TraceResult *ptr, Vector vecSrc, Vector vecEnd, int
|
|||
const char *pTextureName;
|
||||
float rgfl1[3];
|
||||
float rgfl2[3];
|
||||
char *rgsz[4];
|
||||
const char *rgsz[4];
|
||||
int cnt;
|
||||
float fattn = ATTN_NORM;
|
||||
|
||||
|
@ -1838,7 +1838,7 @@ void CSpeaker :: Precache( void )
|
|||
}
|
||||
void CSpeaker :: SpeakerThink( void )
|
||||
{
|
||||
char* szSoundFile;
|
||||
const char* szSoundFile;
|
||||
float flvolume = pev->health * 0.1;
|
||||
float flattenuation = 0.3;
|
||||
int flags = 0;
|
||||
|
|
|
@ -1078,7 +1078,7 @@ float UTIL_SplineFraction( float value, float scale )
|
|||
}
|
||||
|
||||
|
||||
char* UTIL_VarArgs( char *format, ... )
|
||||
char* UTIL_VarArgs( const char *format, ... )
|
||||
{
|
||||
va_list argptr;
|
||||
static char string[1024];
|
||||
|
@ -1609,7 +1609,7 @@ void UTIL_PrecacheOther( const char *szClassname )
|
|||
// UTIL_LogPrintf - Prints a logged message to console.
|
||||
// Preceded by LOG: ( timestamp ) < message >
|
||||
//=========================================================
|
||||
void UTIL_LogPrintf( char *fmt, ... )
|
||||
void UTIL_LogPrintf( const char *fmt, ... )
|
||||
{
|
||||
va_list argptr;
|
||||
static char string[1024];
|
||||
|
|
|
@ -270,7 +270,7 @@ extern float UTIL_Approach( float target, float value, float speed );
|
|||
extern float UTIL_ApproachAngle( float target, float value, float speed );
|
||||
extern float UTIL_AngleDistance( float next, float cur );
|
||||
|
||||
extern char *UTIL_VarArgs( char *format, ... );
|
||||
extern char *UTIL_VarArgs(const char *format, ... );
|
||||
extern void UTIL_Remove( CBaseEntity *pEntity );
|
||||
extern BOOL UTIL_IsValidEntity( edict_t *pent );
|
||||
extern BOOL UTIL_TeamsMatch( const char *pTeamName1, const char *pTeamName2 );
|
||||
|
@ -330,7 +330,7 @@ extern char *UTIL_dtos3( int d );
|
|||
extern char *UTIL_dtos4( int d );
|
||||
|
||||
// Writes message to console with timestamp and FragLog header.
|
||||
extern void UTIL_LogPrintf( char *fmt, ... );
|
||||
extern void UTIL_LogPrintf(const char *fmt, ... );
|
||||
|
||||
// Sorta like FInViewCone, but for nonmonsters.
|
||||
extern float UTIL_DotPoints ( const Vector &vecSrc, const Vector &vecCheck, const Vector &vecDir );
|
||||
|
|
|
@ -894,7 +894,7 @@ BOOL CBasePlayerWeapon :: CanDeploy( void )
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CBasePlayerWeapon :: DefaultDeploy( char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal /* = 0 */, int body )
|
||||
BOOL CBasePlayerWeapon :: DefaultDeploy( const char *szViewModel, const char *szWeaponModel, int iAnim, const char *szAnimExt, int skiplocal /* = 0 */, int body )
|
||||
{
|
||||
if (!CanDeploy( ))
|
||||
return FALSE;
|
||||
|
|
|
@ -217,7 +217,7 @@ public:
|
|||
|
||||
virtual BOOL CanDeploy( void );
|
||||
virtual BOOL IsUseable( void );
|
||||
BOOL DefaultDeploy( char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal = 0, int body = 0 );
|
||||
BOOL DefaultDeploy( const char *szViewModel, const char *szWeaponModel, int iAnim, const char *szAnimExt, int skiplocal = 0, int body = 0 );
|
||||
virtual BOOL DefaultReload( int iClipSize, int iAnim, float fDelay, int body = 0 );
|
||||
|
||||
virtual void ItemPostFrame( void ); // called each frame by the player PostThink
|
||||
|
|
|
@ -302,7 +302,7 @@ globalentity_t *CGlobalState :: Find( string_t globalname )
|
|||
//#ifdef _DEBUG
|
||||
void CGlobalState :: DumpGlobals( void )
|
||||
{
|
||||
static char *estates[] = { "Off", "On", "Dead" };
|
||||
static const char *estates[] = { "Off", "On", "Dead" };
|
||||
globalentity_t *pTest;
|
||||
|
||||
ALERT( at_console, "-- Globals --\n" );
|
||||
|
|
|
@ -40,14 +40,14 @@ class CThrownFrag : public CGrenade
|
|||
public:
|
||||
void Spawn();
|
||||
|
||||
static CThrownFrag *ThrowFrag( unsigned int usEvent, entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time, char *pszExplosiveModel, float flDamage, float flResistance)
|
||||
static CThrownFrag *ThrowFrag( unsigned int usEvent, entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time, const char *pszExplosiveModel, float flDamage, float flResistance)
|
||||
{
|
||||
return ThrowExplosive( GetClassPtr((CThrownFrag*)NULL), usEvent, pevOwner,
|
||||
vecStart, vecVelocity, time,
|
||||
pszExplosiveModel, flDamage, flResistance );
|
||||
}
|
||||
|
||||
static CThrownFrag *ThrowExplosive(CThrownFrag *PtrFrag, unsigned int usEvent, entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time, char *pszExplosiveModel, float flDamage, float flResistance);
|
||||
static CThrownFrag *ThrowExplosive(CThrownFrag *PtrFrag, unsigned int usEvent, entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time, const char *pszExplosiveModel, float flDamage, float flResistance);
|
||||
|
||||
virtual void TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType,int PenetrationValue = 0)
|
||||
{
|
||||
|
@ -81,7 +81,7 @@ public:
|
|||
pev->classname = MAKE_STRING("pipe_bomb");
|
||||
}
|
||||
|
||||
static CThrownPipeBomb *ThrowPipeBomb( unsigned int usEvent, entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time, char *pszExplosiveModel, float flDamage, float flResistance)
|
||||
static CThrownPipeBomb *ThrowPipeBomb( unsigned int usEvent, entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time, const char *pszExplosiveModel, float flDamage, float flResistance)
|
||||
{
|
||||
return (CThrownPipeBomb*)ThrowExplosive( GetClassPtr((CThrownPipeBomb*)NULL), usEvent, pevOwner,
|
||||
vecStart, vecVelocity, time,
|
||||
|
@ -836,7 +836,7 @@ void CThrownFrag::Spawn()
|
|||
UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0));
|
||||
}
|
||||
|
||||
CThrownFrag *CThrownFrag::ThrowExplosive(CThrownFrag *PtrFrag, unsigned int usEvent,entvars_t *pevOwner,Vector vecStart,Vector vecVelocity,float time,char *pszExplosiveModel,float flDamage, float flResistance)
|
||||
CThrownFrag *CThrownFrag::ThrowExplosive(CThrownFrag *PtrFrag, unsigned int usEvent,entvars_t *pevOwner,Vector vecStart,Vector vecVelocity,float time,const char *pszExplosiveModel,float flDamage, float flResistance)
|
||||
{
|
||||
CThrownFrag *pRetExplosive = PtrFrag;
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
void Spawn();
|
||||
void Precache();
|
||||
|
||||
static CThrownMelee *ThrowObject(CBasePlayer *pPlayer,Vector vecOrigin,Vector vecVelocity,float flDmg,char *pszModel,char *pszClassname);
|
||||
static CThrownMelee *ThrowObject(CBasePlayer *pPlayer,Vector vecOrigin,Vector vecVelocity,float flDmg,const char *pszModel,const char *pszClassname);
|
||||
|
||||
// Thinks
|
||||
void EXPORT ThrownTouch(CBaseEntity *pOther);
|
||||
|
@ -51,7 +51,7 @@ public:
|
|||
private:
|
||||
CBasePlayer *m_pPlayer;
|
||||
|
||||
char *m_pszGiveClassname;
|
||||
const char *m_pszGiveClassname;
|
||||
float m_flDieTime;
|
||||
};
|
||||
LINK_ENTITY_TO_CLASS(thrown_object,CThrownMelee);
|
||||
|
@ -1174,7 +1174,7 @@ void CThrownMelee::Precache()
|
|||
PRECACHE_SOUND("weapons/knife_hitbod2.wav");
|
||||
}
|
||||
|
||||
CThrownMelee *CThrownMelee::ThrowObject(CBasePlayer *pPlayer,Vector vecOrigin,Vector vecVelocity,float flDmg,char *pszModel,char *pszGiveClass)
|
||||
CThrownMelee *CThrownMelee::ThrowObject(CBasePlayer *pPlayer,Vector vecOrigin,Vector vecVelocity,float flDmg,const char *pszModel,const char *pszGiveClass)
|
||||
{
|
||||
CThrownMelee *pRetObject = GetClassPtr((CThrownMelee*)NULL);
|
||||
|
||||
|
|
Loading…
Reference in a new issue