mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-23 13:14:51 +00:00
Redefine string_t. Fix wrong variables type.
This commit is contained in:
parent
34c577572b
commit
18adf0979f
@ -23,7 +23,7 @@
|
||||
|
||||
// Header file containing definition of globalvars_t and entvars_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
|
||||
|
||||
//=========================================================
|
||||
|
@ -733,7 +733,7 @@ enum
|
||||
};
|
||||
|
||||
typedef unsigned int func_t;
|
||||
typedef unsigned int string_t;
|
||||
typedef int string_t;
|
||||
|
||||
typedef unsigned char byte;
|
||||
typedef unsigned short word;
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
virtual int Restore( CRestore &restore );
|
||||
static TYPEDESCRIPTION m_SaveData[];
|
||||
|
||||
int m_preSequence;
|
||||
string_t m_preSequence;
|
||||
};
|
||||
|
||||
LINK_ENTITY_TO_CLASS( info_bigmomma, CInfoBM )
|
||||
|
@ -438,7 +438,7 @@ class CBaseDelay : public CBaseEntity
|
||||
{
|
||||
public:
|
||||
float m_flDelay;
|
||||
int m_iszKillTarget;
|
||||
string_t m_iszKillTarget;
|
||||
|
||||
virtual void KeyValue( KeyValueData *pkvd );
|
||||
virtual int Save( CSave &save );
|
||||
|
@ -379,9 +379,10 @@ public:
|
||||
|
||||
void BeamUpdateVars( void );
|
||||
|
||||
string_t m_iszStartEntity;
|
||||
string_t m_iszEndEntity;
|
||||
string_t m_iszSpriteName;
|
||||
int m_active;
|
||||
int m_iszStartEntity;
|
||||
int m_iszEndEntity;
|
||||
float m_life;
|
||||
int m_boltWidth;
|
||||
int m_noiseAmplitude;
|
||||
@ -389,7 +390,6 @@ public:
|
||||
int m_speed;
|
||||
float m_restrike;
|
||||
int m_spriteTexture;
|
||||
int m_iszSpriteName;
|
||||
int m_frameStart;
|
||||
|
||||
float m_radius;
|
||||
|
@ -321,7 +321,7 @@ public:
|
||||
static TYPEDESCRIPTION m_SaveData[];
|
||||
|
||||
CSprite *m_pSprite;
|
||||
int m_iszSpriteName;
|
||||
string_t m_iszSpriteName;
|
||||
Vector m_firePosition;
|
||||
};
|
||||
#endif //EFFECTS_H
|
||||
|
@ -69,7 +69,7 @@ typedef int BOOL;
|
||||
|
||||
// Header file containing definition of globalvars_t and entvars_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
|
||||
|
||||
// Vector class
|
||||
|
@ -82,9 +82,9 @@ public:
|
||||
|
||||
Materials m_Material;
|
||||
Explosions m_Explosion;
|
||||
string_t m_iszGibModel;
|
||||
string_t m_iszSpawnObject;
|
||||
int m_idShard;
|
||||
float m_angle;
|
||||
int m_iszGibModel;
|
||||
int m_iszSpawnObject;
|
||||
};
|
||||
#endif // FUNC_BREAK_H
|
||||
|
@ -97,6 +97,9 @@ public:
|
||||
|
||||
protected:
|
||||
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;
|
||||
Vector m_vecControllerUsePos;
|
||||
|
||||
@ -120,14 +123,11 @@ protected:
|
||||
|
||||
Vector m_barrelPos; // Length of the freakin barrel
|
||||
float m_spriteScale; // Scale of any sprites we shoot
|
||||
int m_iszSpriteSmoke;
|
||||
int m_iszSpriteFlash;
|
||||
TANKBULLET m_bulletType; // Bullet type
|
||||
int m_iBulletDamage; // 0 means use Bullet type's default damage
|
||||
|
||||
Vector m_sightOrigin; // Last sight of target
|
||||
int m_spread; // firing spread
|
||||
int m_iszMaster; // Master entity (game_team_master or multisource)
|
||||
};
|
||||
|
||||
TYPEDESCRIPTION CFuncTank::m_SaveData[] =
|
||||
|
@ -37,8 +37,8 @@ public:
|
||||
static TYPEDESCRIPTION m_SaveData[];
|
||||
|
||||
private:
|
||||
string_t m_iszPattern;
|
||||
int m_iStyle;
|
||||
int m_iszPattern;
|
||||
};
|
||||
|
||||
LINK_ENTITY_TO_CLASS( light, CLight )
|
||||
|
@ -45,8 +45,8 @@ public:
|
||||
|
||||
void EXPORT FieldUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
|
||||
|
||||
int m_iszXController;
|
||||
int m_iszYController;
|
||||
string_t m_iszXController;
|
||||
string_t m_iszYController;
|
||||
float m_flSpread;
|
||||
float m_flDelay;
|
||||
int m_iCount;
|
||||
|
@ -1619,9 +1619,9 @@ public:
|
||||
|
||||
CFuncTrackTrain *m_train;
|
||||
|
||||
int m_trackTopName;
|
||||
int m_trackBottomName;
|
||||
int m_trainName;
|
||||
string_t m_trackTopName;
|
||||
string_t m_trackBottomName;
|
||||
string_t m_trainName;
|
||||
TRAIN_CODE m_code;
|
||||
int m_targetState;
|
||||
int m_use;
|
||||
|
@ -907,15 +907,15 @@ public:
|
||||
BOOL StartSentence( CBaseMonster *pTarget );
|
||||
|
||||
private:
|
||||
int m_iszSentence; // string index for idle animation
|
||||
int m_iszEntity; // entity that is wanted for this sentence
|
||||
string_t m_iszSentence; // string index for idle animation
|
||||
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_flDuration; // How long the sentence lasts
|
||||
float m_flRepeat; // repeat rate
|
||||
float m_flAttenuation;
|
||||
float m_flVolume;
|
||||
BOOL m_active;
|
||||
int m_iszListener; // name of entity to look at while talking
|
||||
};
|
||||
|
||||
#define SF_SENTENCE_ONCE 0x0001
|
||||
|
@ -77,9 +77,9 @@ public:
|
||||
void AllowInterrupt( BOOL fAllow );
|
||||
int IgnoreConditions( void );
|
||||
|
||||
int m_iszIdle; // string index for idle animation
|
||||
int m_iszPlay; // string index for scripted animation
|
||||
int m_iszEntity; // entity that is wanted for this script
|
||||
string_t m_iszIdle; // string index for idle animation
|
||||
string_t m_iszPlay; // string index for scripted animation
|
||||
string_t m_iszEntity; // entity that is wanted for this script
|
||||
int m_fMoveTo;
|
||||
int m_iFinishSchedule;
|
||||
float m_flRadius; // range to search
|
||||
|
@ -162,8 +162,8 @@ public:
|
||||
int m_voicePitch; // pitch of voice for this head
|
||||
const char *m_szGrp[TLK_CGROUPS]; // sentence group names
|
||||
float m_useTime; // Don't allow +USE until this time
|
||||
int m_iszUse; // Custom +USE sentence group (follow)
|
||||
int m_iszUnUse; // Custom +USE sentence group (stop following)
|
||||
string_t m_iszUse; // Custom +USE sentence group (follow)
|
||||
string_t m_iszUnUse; // Custom +USE sentence group (stop following)
|
||||
|
||||
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.
|
||||
|
@ -114,7 +114,7 @@ public:
|
||||
static TYPEDESCRIPTION m_SaveData[];
|
||||
|
||||
private:
|
||||
int m_globalstate;
|
||||
string_t m_globalstate;
|
||||
USE_TYPE triggerType;
|
||||
};
|
||||
|
||||
@ -267,11 +267,11 @@ public:
|
||||
|
||||
static TYPEDESCRIPTION m_SaveData[];
|
||||
|
||||
int m_cTargets; // the total number of targets in this manager's fire list.
|
||||
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_index; // Current target
|
||||
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:
|
||||
inline BOOL IsClone( void ) { return ( pev->spawnflags & SF_MULTIMAN_CLONE ) ? TRUE : FALSE; }
|
||||
inline BOOL ShouldClone( void )
|
||||
@ -1321,9 +1321,9 @@ public:
|
||||
|
||||
static TYPEDESCRIPTION m_SaveData[];
|
||||
|
||||
string_t m_changeTarget;
|
||||
char m_szMapName[cchMapNameMost]; // trigger_changelevel only: next map
|
||||
char m_szLandmarkName[cchMapNameMost]; // trigger_changelevel only: landmark on next map
|
||||
int m_changeTarget;
|
||||
float m_changeTargetDelay;
|
||||
};
|
||||
|
||||
@ -2054,7 +2054,7 @@ public:
|
||||
static TYPEDESCRIPTION m_SaveData[];
|
||||
|
||||
private:
|
||||
int m_iszNewTarget;
|
||||
string_t m_iszNewTarget;
|
||||
};
|
||||
|
||||
LINK_ENTITY_TO_CLASS( trigger_changetarget, CTriggerChangeTarget )
|
||||
@ -2117,7 +2117,7 @@ public:
|
||||
EHANDLE m_hPlayer;
|
||||
EHANDLE m_hTarget;
|
||||
CBaseEntity *m_pentPath;
|
||||
int m_sPath;
|
||||
string_t m_sPath;
|
||||
float m_flWait;
|
||||
float m_flReturnTime;
|
||||
float m_flStopTime;
|
||||
|
@ -1586,7 +1586,7 @@ void UTIL_StripToken( const char *pKey, char *pDest )
|
||||
static int gSizes[FIELD_TYPECOUNT] =
|
||||
{
|
||||
sizeof(float), // FIELD_FLOAT
|
||||
sizeof(int), // FIELD_STRING
|
||||
sizeof(string_t), // FIELD_STRING
|
||||
sizeof(void*), // FIELD_ENTITY
|
||||
sizeof(void*), // FIELD_CLASSPTR
|
||||
sizeof(void*), // FIELD_EHANDLE
|
||||
@ -1613,7 +1613,7 @@ static int gSizes[FIELD_TYPECOUNT] =
|
||||
static int gInputSizes[FIELD_TYPECOUNT] =
|
||||
{
|
||||
sizeof(float), // FIELD_FLOAT
|
||||
sizeof(int), // FIELD_STRING
|
||||
sizeof(string_t), // FIELD_STRING
|
||||
sizeof(int), // FIELD_ENTITY
|
||||
sizeof(int), // FIELD_CLASSPTR
|
||||
sizeof(int), // FIELD_EHANDLE
|
||||
@ -1940,7 +1940,7 @@ void EntvarsKeyvalue( entvars_t *pev, KeyValueData *pkvd )
|
||||
case FIELD_MODELNAME:
|
||||
case FIELD_SOUNDNAME:
|
||||
case FIELD_STRING:
|
||||
( *(int *)( (char *)pev + pField->fieldOffset ) ) = ALLOC_STRING( pkvd->szValue );
|
||||
( *(string_t *)( (char *)pev + pField->fieldOffset ) ) = ALLOC_STRING( pkvd->szValue );
|
||||
break;
|
||||
case FIELD_TIME:
|
||||
case FIELD_FLOAT:
|
||||
@ -2014,7 +2014,7 @@ int CSave::WriteFields( const char *pname, void *pBaseData, TYPEDESCRIPTION *pFi
|
||||
case FIELD_MODELNAME:
|
||||
case FIELD_SOUNDNAME:
|
||||
case FIELD_STRING:
|
||||
WriteString( pTest->fieldName, (int *)pOutputData, pTest->fieldSize );
|
||||
WriteString( pTest->fieldName, (string_t *)pOutputData, pTest->fieldSize );
|
||||
break;
|
||||
case FIELD_CLASSPTR:
|
||||
case FIELD_EVARS:
|
||||
@ -2197,14 +2197,14 @@ int CRestore::ReadField( void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCou
|
||||
}
|
||||
pInputData = pString;
|
||||
if( strlen( (char *)pInputData ) == 0 )
|
||||
*( (int *)pOutputData ) = 0;
|
||||
*( (string_t *)pOutputData ) = 0;
|
||||
else
|
||||
{
|
||||
int string;
|
||||
string_t string;
|
||||
|
||||
string = ALLOC_STRING( (char *)pInputData );
|
||||
|
||||
*( (int *)pOutputData ) = string;
|
||||
*( (string_t *)pOutputData ) = string;
|
||||
|
||||
if( !FStringNull( string ) && m_precache )
|
||||
{
|
||||
|
@ -37,13 +37,13 @@ extern globalvars_t *gpGlobals;
|
||||
#define STRING(offset) (const char *)(gpGlobals->pStringBase + (int)offset)
|
||||
|
||||
#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
|
||||
static inline int MAKE_STRING(const char *szValue)
|
||||
{
|
||||
long long ptrdiff = szValue - STRING(0);
|
||||
if( ptrdiff > INT_MAX || ptrdiff < INT_MIN )
|
||||
return ALLOC_STRING(szValue);
|
||||
return ALLOC_STRING( szValue );
|
||||
else
|
||||
return (int)ptrdiff;
|
||||
}
|
||||
|
@ -446,7 +446,7 @@ public:
|
||||
|
||||
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_cAmmoTypes;// how many ammo types packed into this box (if packed by a level designer)
|
||||
|
Loading…
x
Reference in New Issue
Block a user