Browse Source

Redefine string_t. Fix wrong variables type.

asheep
Night Owl 7 years ago
parent
commit
18adf0979f
  1. 2
      cl_dll/util_vector.h
  2. 2
      common/const.h
  3. 2
      dlls/bigmomma.cpp
  4. 2
      dlls/cbase.h
  5. 6
      dlls/effects.cpp
  6. 2
      dlls/effects.h
  7. 2
      dlls/extdll.h
  8. 4
      dlls/func_break.h
  9. 6
      dlls/func_tank.cpp
  10. 2
      dlls/lights.cpp
  11. 4
      dlls/mortar.cpp
  12. 6
      dlls/plats.cpp
  13. 6
      dlls/scripted.cpp
  14. 6
      dlls/scripted.h
  15. 4
      dlls/talkmonster.h
  16. 12
      dlls/triggers.cpp
  17. 14
      dlls/util.cpp
  18. 4
      dlls/util.h
  19. 2
      dlls/weapons.h

2
cl_dll/util_vector.h

@ -23,7 +23,7 @@
// Header file containing definition of globalvars_t and entvars_t // Header file containing definition of globalvars_t and entvars_t
typedef unsigned int func_t; // typedef unsigned int func_t; //
typedef unsigned int string_t; // from engine's pr_comp.h; typedef int string_t; // from engine's pr_comp.h;
typedef float vec_t; // needed before including progdefs.h typedef float vec_t; // needed before including progdefs.h
//========================================================= //=========================================================

2
common/const.h

@ -733,7 +733,7 @@ enum
}; };
typedef unsigned int func_t; typedef unsigned int func_t;
typedef unsigned int string_t; typedef int string_t;
typedef unsigned char byte; typedef unsigned char byte;
typedef unsigned short word; typedef unsigned short word;

2
dlls/bigmomma.cpp

@ -49,7 +49,7 @@ public:
virtual int Restore( CRestore &restore ); virtual int Restore( CRestore &restore );
static TYPEDESCRIPTION m_SaveData[]; static TYPEDESCRIPTION m_SaveData[];
int m_preSequence; string_t m_preSequence;
}; };
LINK_ENTITY_TO_CLASS( info_bigmomma, CInfoBM ) LINK_ENTITY_TO_CLASS( info_bigmomma, CInfoBM )

2
dlls/cbase.h

@ -438,7 +438,7 @@ class CBaseDelay : public CBaseEntity
{ {
public: public:
float m_flDelay; float m_flDelay;
int m_iszKillTarget; string_t m_iszKillTarget;
virtual void KeyValue( KeyValueData *pkvd ); virtual void KeyValue( KeyValueData *pkvd );
virtual int Save( CSave &save ); virtual int Save( CSave &save );

6
dlls/effects.cpp

@ -379,9 +379,10 @@ public:
void BeamUpdateVars( void ); void BeamUpdateVars( void );
string_t m_iszStartEntity;
string_t m_iszEndEntity;
string_t m_iszSpriteName;
int m_active; int m_active;
int m_iszStartEntity;
int m_iszEndEntity;
float m_life; float m_life;
int m_boltWidth; int m_boltWidth;
int m_noiseAmplitude; int m_noiseAmplitude;
@ -389,7 +390,6 @@ public:
int m_speed; int m_speed;
float m_restrike; float m_restrike;
int m_spriteTexture; int m_spriteTexture;
int m_iszSpriteName;
int m_frameStart; int m_frameStart;
float m_radius; float m_radius;

2
dlls/effects.h

@ -321,7 +321,7 @@ public:
static TYPEDESCRIPTION m_SaveData[]; static TYPEDESCRIPTION m_SaveData[];
CSprite *m_pSprite; CSprite *m_pSprite;
int m_iszSpriteName; string_t m_iszSpriteName;
Vector m_firePosition; Vector m_firePosition;
}; };
#endif //EFFECTS_H #endif //EFFECTS_H

2
dlls/extdll.h

@ -69,7 +69,7 @@ typedef int BOOL;
// Header file containing definition of globalvars_t and entvars_t // Header file containing definition of globalvars_t and entvars_t
typedef unsigned int func_t; typedef unsigned int func_t;
typedef unsigned int string_t; // from engine's pr_comp.h; typedef int string_t; // from engine's pr_comp.h;
typedef float vec_t; // needed before including progdefs.h typedef float vec_t; // needed before including progdefs.h
// Vector class // Vector class

4
dlls/func_break.h

@ -82,9 +82,9 @@ public:
Materials m_Material; Materials m_Material;
Explosions m_Explosion; Explosions m_Explosion;
string_t m_iszGibModel;
string_t m_iszSpawnObject;
int m_idShard; int m_idShard;
float m_angle; float m_angle;
int m_iszGibModel;
int m_iszSpawnObject;
}; };
#endif // FUNC_BREAK_H #endif // FUNC_BREAK_H

6
dlls/func_tank.cpp

@ -97,6 +97,9 @@ public:
protected: protected:
CBasePlayer* m_pController; CBasePlayer* m_pController;
string_t m_iszSpriteSmoke;
string_t m_iszSpriteFlash;
string_t m_iszMaster; // Master entity (game_team_master or multisource)
float m_flNextAttack; float m_flNextAttack;
Vector m_vecControllerUsePos; Vector m_vecControllerUsePos;
@ -120,14 +123,11 @@ protected:
Vector m_barrelPos; // Length of the freakin barrel Vector m_barrelPos; // Length of the freakin barrel
float m_spriteScale; // Scale of any sprites we shoot float m_spriteScale; // Scale of any sprites we shoot
int m_iszSpriteSmoke;
int m_iszSpriteFlash;
TANKBULLET m_bulletType; // Bullet type TANKBULLET m_bulletType; // Bullet type
int m_iBulletDamage; // 0 means use Bullet type's default damage int m_iBulletDamage; // 0 means use Bullet type's default damage
Vector m_sightOrigin; // Last sight of target Vector m_sightOrigin; // Last sight of target
int m_spread; // firing spread int m_spread; // firing spread
int m_iszMaster; // Master entity (game_team_master or multisource)
}; };
TYPEDESCRIPTION CFuncTank::m_SaveData[] = TYPEDESCRIPTION CFuncTank::m_SaveData[] =

2
dlls/lights.cpp

@ -37,8 +37,8 @@ public:
static TYPEDESCRIPTION m_SaveData[]; static TYPEDESCRIPTION m_SaveData[];
private: private:
string_t m_iszPattern;
int m_iStyle; int m_iStyle;
int m_iszPattern;
}; };
LINK_ENTITY_TO_CLASS( light, CLight ) LINK_ENTITY_TO_CLASS( light, CLight )

4
dlls/mortar.cpp

@ -45,8 +45,8 @@ public:
void EXPORT FieldUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ); void EXPORT FieldUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
int m_iszXController; string_t m_iszXController;
int m_iszYController; string_t m_iszYController;
float m_flSpread; float m_flSpread;
float m_flDelay; float m_flDelay;
int m_iCount; int m_iCount;

6
dlls/plats.cpp

@ -1619,9 +1619,9 @@ public:
CFuncTrackTrain *m_train; CFuncTrackTrain *m_train;
int m_trackTopName; string_t m_trackTopName;
int m_trackBottomName; string_t m_trackBottomName;
int m_trainName; string_t m_trainName;
TRAIN_CODE m_code; TRAIN_CODE m_code;
int m_targetState; int m_targetState;
int m_use; int m_use;

6
dlls/scripted.cpp

@ -907,15 +907,15 @@ public:
BOOL StartSentence( CBaseMonster *pTarget ); BOOL StartSentence( CBaseMonster *pTarget );
private: private:
int m_iszSentence; // string index for idle animation string_t m_iszSentence; // string index for idle animation
int m_iszEntity; // entity that is wanted for this sentence string_t m_iszEntity; // entity that is wanted for this sentence
string_t m_iszListener; // name of entity to look at while talking
float m_flRadius; // range to search float m_flRadius; // range to search
float m_flDuration; // How long the sentence lasts float m_flDuration; // How long the sentence lasts
float m_flRepeat; // repeat rate float m_flRepeat; // repeat rate
float m_flAttenuation; float m_flAttenuation;
float m_flVolume; float m_flVolume;
BOOL m_active; BOOL m_active;
int m_iszListener; // name of entity to look at while talking
}; };
#define SF_SENTENCE_ONCE 0x0001 #define SF_SENTENCE_ONCE 0x0001

6
dlls/scripted.h

@ -77,9 +77,9 @@ public:
void AllowInterrupt( BOOL fAllow ); void AllowInterrupt( BOOL fAllow );
int IgnoreConditions( void ); int IgnoreConditions( void );
int m_iszIdle; // string index for idle animation string_t m_iszIdle; // string index for idle animation
int m_iszPlay; // string index for scripted animation string_t m_iszPlay; // string index for scripted animation
int m_iszEntity; // entity that is wanted for this script string_t m_iszEntity; // entity that is wanted for this script
int m_fMoveTo; int m_fMoveTo;
int m_iFinishSchedule; int m_iFinishSchedule;
float m_flRadius; // range to search float m_flRadius; // range to search

4
dlls/talkmonster.h

@ -162,8 +162,8 @@ public:
int m_voicePitch; // pitch of voice for this head int m_voicePitch; // pitch of voice for this head
const char *m_szGrp[TLK_CGROUPS]; // sentence group names const char *m_szGrp[TLK_CGROUPS]; // sentence group names
float m_useTime; // Don't allow +USE until this time float m_useTime; // Don't allow +USE until this time
int m_iszUse; // Custom +USE sentence group (follow) string_t m_iszUse; // Custom +USE sentence group (follow)
int m_iszUnUse; // Custom +USE sentence group (stop following) string_t m_iszUnUse; // Custom +USE sentence group (stop following)
float m_flLastSaidSmelled;// last time we talked about something that stinks float m_flLastSaidSmelled;// last time we talked about something that stinks
float m_flStopTalkTime;// when in the future that I'll be done saying this sentence. float m_flStopTalkTime;// when in the future that I'll be done saying this sentence.

12
dlls/triggers.cpp

@ -114,7 +114,7 @@ public:
static TYPEDESCRIPTION m_SaveData[]; static TYPEDESCRIPTION m_SaveData[];
private: private:
int m_globalstate; string_t m_globalstate;
USE_TYPE triggerType; USE_TYPE triggerType;
}; };
@ -267,11 +267,11 @@ public:
static TYPEDESCRIPTION m_SaveData[]; static TYPEDESCRIPTION m_SaveData[];
string_t m_iTargetName[MAX_MULTI_TARGETS];// list if indexes into global string array
float m_flTargetDelay[MAX_MULTI_TARGETS];// delay (in seconds) from time of manager fire to target fire
int m_cTargets; // the total number of targets in this manager's fire list. int m_cTargets; // the total number of targets in this manager's fire list.
int m_index; // Current target int m_index; // Current target
float m_startTime;// Time we started firing float m_startTime;// Time we started firing
int m_iTargetName[MAX_MULTI_TARGETS];// list if indexes into global string array
float m_flTargetDelay[MAX_MULTI_TARGETS];// delay (in seconds) from time of manager fire to target fire
private: private:
inline BOOL IsClone( void ) { return ( pev->spawnflags & SF_MULTIMAN_CLONE ) ? TRUE : FALSE; } inline BOOL IsClone( void ) { return ( pev->spawnflags & SF_MULTIMAN_CLONE ) ? TRUE : FALSE; }
inline BOOL ShouldClone( void ) inline BOOL ShouldClone( void )
@ -1321,9 +1321,9 @@ public:
static TYPEDESCRIPTION m_SaveData[]; static TYPEDESCRIPTION m_SaveData[];
string_t m_changeTarget;
char m_szMapName[cchMapNameMost]; // trigger_changelevel only: next map char m_szMapName[cchMapNameMost]; // trigger_changelevel only: next map
char m_szLandmarkName[cchMapNameMost]; // trigger_changelevel only: landmark on next map char m_szLandmarkName[cchMapNameMost]; // trigger_changelevel only: landmark on next map
int m_changeTarget;
float m_changeTargetDelay; float m_changeTargetDelay;
}; };
@ -2054,7 +2054,7 @@ public:
static TYPEDESCRIPTION m_SaveData[]; static TYPEDESCRIPTION m_SaveData[];
private: private:
int m_iszNewTarget; string_t m_iszNewTarget;
}; };
LINK_ENTITY_TO_CLASS( trigger_changetarget, CTriggerChangeTarget ) LINK_ENTITY_TO_CLASS( trigger_changetarget, CTriggerChangeTarget )
@ -2117,7 +2117,7 @@ public:
EHANDLE m_hPlayer; EHANDLE m_hPlayer;
EHANDLE m_hTarget; EHANDLE m_hTarget;
CBaseEntity *m_pentPath; CBaseEntity *m_pentPath;
int m_sPath; string_t m_sPath;
float m_flWait; float m_flWait;
float m_flReturnTime; float m_flReturnTime;
float m_flStopTime; float m_flStopTime;

14
dlls/util.cpp

@ -1586,7 +1586,7 @@ void UTIL_StripToken( const char *pKey, char *pDest )
static int gSizes[FIELD_TYPECOUNT] = static int gSizes[FIELD_TYPECOUNT] =
{ {
sizeof(float), // FIELD_FLOAT sizeof(float), // FIELD_FLOAT
sizeof(int), // FIELD_STRING sizeof(string_t), // FIELD_STRING
sizeof(void*), // FIELD_ENTITY sizeof(void*), // FIELD_ENTITY
sizeof(void*), // FIELD_CLASSPTR sizeof(void*), // FIELD_CLASSPTR
sizeof(void*), // FIELD_EHANDLE sizeof(void*), // FIELD_EHANDLE
@ -1613,7 +1613,7 @@ static int gSizes[FIELD_TYPECOUNT] =
static int gInputSizes[FIELD_TYPECOUNT] = static int gInputSizes[FIELD_TYPECOUNT] =
{ {
sizeof(float), // FIELD_FLOAT sizeof(float), // FIELD_FLOAT
sizeof(int), // FIELD_STRING sizeof(string_t), // FIELD_STRING
sizeof(int), // FIELD_ENTITY sizeof(int), // FIELD_ENTITY
sizeof(int), // FIELD_CLASSPTR sizeof(int), // FIELD_CLASSPTR
sizeof(int), // FIELD_EHANDLE sizeof(int), // FIELD_EHANDLE
@ -1940,7 +1940,7 @@ void EntvarsKeyvalue( entvars_t *pev, KeyValueData *pkvd )
case FIELD_MODELNAME: case FIELD_MODELNAME:
case FIELD_SOUNDNAME: case FIELD_SOUNDNAME:
case FIELD_STRING: case FIELD_STRING:
( *(int *)( (char *)pev + pField->fieldOffset ) ) = ALLOC_STRING( pkvd->szValue ); ( *(string_t *)( (char *)pev + pField->fieldOffset ) ) = ALLOC_STRING( pkvd->szValue );
break; break;
case FIELD_TIME: case FIELD_TIME:
case FIELD_FLOAT: case FIELD_FLOAT:
@ -2014,7 +2014,7 @@ int CSave::WriteFields( const char *pname, void *pBaseData, TYPEDESCRIPTION *pFi
case FIELD_MODELNAME: case FIELD_MODELNAME:
case FIELD_SOUNDNAME: case FIELD_SOUNDNAME:
case FIELD_STRING: case FIELD_STRING:
WriteString( pTest->fieldName, (int *)pOutputData, pTest->fieldSize ); WriteString( pTest->fieldName, (string_t *)pOutputData, pTest->fieldSize );
break; break;
case FIELD_CLASSPTR: case FIELD_CLASSPTR:
case FIELD_EVARS: case FIELD_EVARS:
@ -2197,14 +2197,14 @@ int CRestore::ReadField( void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCou
} }
pInputData = pString; pInputData = pString;
if( strlen( (char *)pInputData ) == 0 ) if( strlen( (char *)pInputData ) == 0 )
*( (int *)pOutputData ) = 0; *( (string_t *)pOutputData ) = 0;
else else
{ {
int string; string_t string;
string = ALLOC_STRING( (char *)pInputData ); string = ALLOC_STRING( (char *)pInputData );
*( (int *)pOutputData ) = string; *( (string_t *)pOutputData ) = string;
if( !FStringNull( string ) && m_precache ) if( !FStringNull( string ) && m_precache )
{ {

4
dlls/util.h

@ -37,13 +37,13 @@ extern globalvars_t *gpGlobals;
#define STRING(offset) (const char *)(gpGlobals->pStringBase + (int)offset) #define STRING(offset) (const char *)(gpGlobals->pStringBase + (int)offset)
#if !defined XASH_64BIT || defined(CLIENT_DLL) #if !defined XASH_64BIT || defined(CLIENT_DLL)
#define MAKE_STRING(str) ((size_t)str - (size_t)STRING(0)) #define MAKE_STRING(str) ((int)str - (int)STRING(0))
#else #else
static inline int MAKE_STRING(const char *szValue) static inline int MAKE_STRING(const char *szValue)
{ {
long long ptrdiff = szValue - STRING(0); long long ptrdiff = szValue - STRING(0);
if( ptrdiff > INT_MAX || ptrdiff < INT_MIN ) if( ptrdiff > INT_MAX || ptrdiff < INT_MIN )
return ALLOC_STRING(szValue); return ALLOC_STRING( szValue );
else else
return (int)ptrdiff; return (int)ptrdiff;
} }

2
dlls/weapons.h

@ -446,7 +446,7 @@ public:
CBasePlayerItem *m_rgpPlayerItems[MAX_ITEM_TYPES];// one slot for each CBasePlayerItem *m_rgpPlayerItems[MAX_ITEM_TYPES];// one slot for each
int m_rgiszAmmo[MAX_AMMO_SLOTS];// ammo names string_t m_rgiszAmmo[MAX_AMMO_SLOTS];// ammo names
int m_rgAmmo[MAX_AMMO_SLOTS];// ammo quantities int m_rgAmmo[MAX_AMMO_SLOTS];// ammo quantities
int m_cAmmoTypes;// how many ammo types packed into this box (if packed by a level designer) int m_cAmmoTypes;// how many ammo types packed into this box (if packed by a level designer)

Loading…
Cancel
Save