return pEnt->state; return GLOBAL_OFF; } // Global Savedata for Delay TYPEDESCRIPTION CGlobalState::m_SaveData[] = { DEFINE_FIELD( CGlobalState, m_listCount, FIELD_INTEGER ), }; // Global Savedata for Delay TYPEDESCRIPTION gGlobalEntitySaveData[] = { DEFINE_ARRAY( globalentity_t, name, FIELD_CHARACTER, 64 ), DEFINE_ARRAY( globalentity_t, levelName, FIELD_CHARACTER, 32 ), DEFINE_FIELD( globalentity_t, state, FIELD_INTEGER ), }; int CGlobalState::Save( CSave &save ) { int i; globalentity_t *pEntity; if ( !save.WriteFields( "GLOBAL", this, m_SaveData, ARRAYSIZE(m_SaveData) ) ) return 0; pEntity = m_pList; for ( i = 0; i < m_listCount && pEntity; i++ )
else newState = oldState; } if ( gGlobalState.EntityInTable( m_globalstate ) ) gGlobalState.EntitySetState( m_globalstate, newState ); else gGlobalState.EntityAdd( m_globalstate, gpGlobals->mapname, newState ); } TYPEDESCRIPTION CMultiSource::m_SaveData[] = { //!!!BUGBUG FIX DEFINE_ARRAY( CMultiSource, m_rgEntities, FIELD_EHANDLE, MS_MAX_TARGETS ), DEFINE_ARRAY( CMultiSource, m_rgTriggered, FIELD_INTEGER, MS_MAX_TARGETS ), DEFINE_FIELD( CMultiSource, m_iTotal, FIELD_INTEGER ), DEFINE_FIELD( CMultiSource, m_globalstate, FIELD_STRING ), }; IMPLEMENT_SAVERESTORE( CMultiSource, CBaseEntity ); LINK_ENTITY_TO_CLASS( multisource, CMultiSource ); // // Cache user-entity-field values until spawn is called. // void CMultiSource::KeyValue( KeyValueData *pkvd ) { if ( FStrEq(pkvd->szKeyName, "style") ||
#include "util.h" #include "cbase.h" #include "nodes.h" #include "monsters.h" #include "animation.h" #include "saverestore.h" #include "squadmonster.h" #include "plane.h" //========================================================= // Save/Restore //========================================================= TYPEDESCRIPTION CSquadMonster::m_SaveData[] = { DEFINE_FIELD( CSquadMonster, m_hSquadLeader, FIELD_EHANDLE ), DEFINE_ARRAY( CSquadMonster, m_hSquadMember, FIELD_EHANDLE, MAX_SQUAD_MEMBERS - 1 ), // DEFINE_FIELD( CSquadMonster, m_afSquadSlots, FIELD_INTEGER ), // these need to be reset after transitions! DEFINE_FIELD( CSquadMonster, m_fEnemyEluded, FIELD_BOOLEAN ), DEFINE_FIELD( CSquadMonster, m_flLastEnemySightTime, FIELD_TIME ), DEFINE_FIELD( CSquadMonster, m_iMySlot, FIELD_INTEGER ), }; IMPLEMENT_SAVERESTORE( CSquadMonster, CBaseMonster ); //========================================================= // OccupySlot - if any slots of the passed slots are
m_pPlayer->pev->viewmodel = iStringNull; m_pPlayer->pev->weaponmodel = iStringNull; //m_pPlayer->pev->viewmodelindex = NULL; g_pGameRules->GetNextBestWeapon( m_pPlayer, this ); } //********************************************************* // weaponbox code: //********************************************************* LINK_ENTITY_TO_CLASS( weaponbox, CWeaponBox ); TYPEDESCRIPTION CWeaponBox::m_SaveData[] = { DEFINE_ARRAY( CWeaponBox, m_rgAmmo, FIELD_INTEGER, MAX_AMMO_SLOTS ), DEFINE_ARRAY( CWeaponBox, m_rgiszAmmo, FIELD_STRING, MAX_AMMO_SLOTS ), DEFINE_ARRAY( CWeaponBox, m_rgpPlayerItems, FIELD_CLASSPTR, MAX_ITEM_TYPES ), DEFINE_FIELD( CWeaponBox, m_cAmmoTypes, FIELD_INTEGER ), }; IMPLEMENT_SAVERESTORE( CWeaponBox, CBaseEntity ); //========================================================= // //========================================================= void CWeaponBox::Precache( void ) { PRECACHE_MODEL("models/w_weaponbox.mdl"); }
CSprite *m_pBall[2]; // hand balls int m_iBall[2]; // how bright it should be float m_iBallTime[2]; // when it should be that color int m_iBallCurrent[2]; // current brightness Vector m_vecEstVelocity; Vector m_velocity; int m_fInCombat; }; LINK_ENTITY_TO_CLASS( monster_alien_controller, CController ); TYPEDESCRIPTION CController::m_SaveData[] = { DEFINE_ARRAY( CController, m_pBall, FIELD_CLASSPTR, 2 ), DEFINE_ARRAY( CController, m_iBall, FIELD_INTEGER, 2 ), DEFINE_ARRAY( CController, m_iBallTime, FIELD_TIME, 2 ), DEFINE_ARRAY( CController, m_iBallCurrent, FIELD_INTEGER, 2 ), DEFINE_FIELD( CController, m_vecEstVelocity, FIELD_VECTOR ), }; IMPLEMENT_SAVERESTORE( CController, CSquadMonster ); const char *CController::pAttackSounds[] = { "controller/con_attack1.wav", "controller/con_attack2.wav", "controller/con_attack3.wav", };
EHANDLE m_hDead; static const char *pAttackHitSounds[]; static const char *pAttackMissSounds[]; static const char *pPainSounds[]; static const char *pDeathSounds[]; }; LINK_ENTITY_TO_CLASS(monster_alien_slave, CISlave); LINK_ENTITY_TO_CLASS(monster_vortigaunt, CISlave); TYPEDESCRIPTION CISlave::m_SaveData[] = { DEFINE_FIELD(CISlave, m_iBravery, FIELD_INTEGER), DEFINE_ARRAY(CISlave, m_pBeam, FIELD_CLASSPTR, ISLAVE_MAX_BEAMS), DEFINE_FIELD(CISlave, m_iBeams, FIELD_INTEGER), DEFINE_FIELD(CISlave, m_flNextAttack, FIELD_TIME), DEFINE_FIELD(CISlave, m_voicePitch, FIELD_INTEGER), DEFINE_FIELD(CISlave, m_hDead, FIELD_EHANDLE), }; IMPLEMENT_SAVERESTORE(CISlave, CSquadMonster); const char *CISlave::pAttackHitSounds[] = { "zombie/claw_strike1.wav", "zombie/claw_strike2.wav",
DEFINE_FIELD( CNihilanth, m_velocity, FIELD_VECTOR ), DEFINE_FIELD( CNihilanth, m_avelocity, FIELD_VECTOR ), DEFINE_FIELD( CNihilanth, m_vecTarget, FIELD_VECTOR ), DEFINE_FIELD( CNihilanth, m_posTarget, FIELD_POSITION_VECTOR ), DEFINE_FIELD( CNihilanth, m_vecDesired, FIELD_VECTOR ), DEFINE_FIELD( CNihilanth, m_posDesired, FIELD_POSITION_VECTOR ), DEFINE_FIELD( CNihilanth, m_flMinZ, FIELD_FLOAT ), DEFINE_FIELD( CNihilanth, m_flMaxZ, FIELD_FLOAT ), DEFINE_FIELD( CNihilanth, m_vecGoal, FIELD_VECTOR ), DEFINE_FIELD( CNihilanth, m_flLastSeen, FIELD_TIME ), DEFINE_FIELD( CNihilanth, m_flPrevSeen, FIELD_TIME ), DEFINE_FIELD( CNihilanth, m_irritation, FIELD_INTEGER ), DEFINE_FIELD( CNihilanth, m_iLevel, FIELD_INTEGER ), DEFINE_FIELD( CNihilanth, m_iTeleport, FIELD_INTEGER ), DEFINE_FIELD( CNihilanth, m_hRecharger, FIELD_EHANDLE ), DEFINE_ARRAY( CNihilanth, m_hSphere, FIELD_EHANDLE, N_SPHERES ), DEFINE_FIELD( CNihilanth, m_iActiveSpheres, FIELD_INTEGER ), DEFINE_FIELD( CNihilanth, m_flAdj, FIELD_FLOAT ), DEFINE_FIELD( CNihilanth, m_pBall, FIELD_CLASSPTR ), DEFINE_ARRAY( CNihilanth, m_szRechargerTarget, FIELD_CHARACTER, 64 ), DEFINE_ARRAY( CNihilanth, m_szDrawUse, FIELD_CHARACTER, 64 ), DEFINE_ARRAY( CNihilanth, m_szTeleportUse, FIELD_CHARACTER, 64 ), DEFINE_ARRAY( CNihilanth, m_szTeleportTouch, FIELD_CHARACTER, 64 ), DEFINE_ARRAY( CNihilanth, m_szDeadUse, FIELD_CHARACTER, 64 ), DEFINE_ARRAY( CNihilanth, m_szDeadTouch, FIELD_CHARACTER, 64 ), DEFINE_FIELD( CNihilanth, m_flShootEnd, FIELD_TIME ), DEFINE_FIELD( CNihilanth, m_flShootTime, FIELD_TIME ), DEFINE_ARRAY( CNihilanth, m_hFriend, FIELD_EHANDLE, 3 ), }; IMPLEMENT_SAVERESTORE( CNihilanth, CBaseMonster );
BOOL m_fLooping; // TRUE when the sound played will loop }; LINK_ENTITY_TO_CLASS( ambient_generic, CAmbientGeneric ); TYPEDESCRIPTION CAmbientGeneric::m_SaveData[] = { DEFINE_FIELD( CAmbientGeneric, m_flAttenuation, FIELD_FLOAT ), DEFINE_FIELD( CAmbientGeneric, m_fActive, FIELD_BOOLEAN ), DEFINE_FIELD( CAmbientGeneric, m_fLooping, FIELD_BOOLEAN ), // HACKHACK - This is not really in the spirit of the save/restore design, but save this // out as a binary data block. If the dynpitchvol_t is changed, old saved games will NOT // load these correctly, so bump the save/restore version if you change the size of the struct // The right way to do this is to split the input parms (read in keyvalue) into members and re-init this // struct in Precache(), but it's unlikely that the struct will change, so it's not worth the time right now. DEFINE_ARRAY( CAmbientGeneric, m_dpv, FIELD_CHARACTER, sizeof(dynpitchvol_t) ), }; IMPLEMENT_SAVERESTORE( CAmbientGeneric, CBaseEntity ); // // ambient_generic - general-purpose user-defined static sound // void CAmbientGeneric :: Spawn( void ) { /* -1 : "Default" 0 : "Everywhere" 200 : "Small Radius" 125 : "Medium Radius" 80 : "Large Radius"
DEFINE_FIELD( COsprey, m_pos2, FIELD_POSITION_VECTOR ), DEFINE_FIELD( COsprey, m_ang1, FIELD_VECTOR ), DEFINE_FIELD( COsprey, m_ang2, FIELD_VECTOR ), DEFINE_FIELD( COsprey, m_startTime, FIELD_TIME ), DEFINE_FIELD( COsprey, m_dTime, FIELD_FLOAT ), DEFINE_FIELD( COsprey, m_velocity, FIELD_VECTOR ), DEFINE_FIELD( COsprey, m_flIdealtilt, FIELD_FLOAT ), DEFINE_FIELD( COsprey, m_flRotortilt, FIELD_FLOAT ), DEFINE_FIELD( COsprey, m_flRightHealth, FIELD_FLOAT ), DEFINE_FIELD( COsprey, m_flLeftHealth, FIELD_FLOAT ), DEFINE_FIELD( COsprey, m_iUnits, FIELD_INTEGER ), DEFINE_ARRAY( COsprey, m_hGrunt, FIELD_EHANDLE, MAX_CARRY ), DEFINE_ARRAY( COsprey, m_vecOrigin, FIELD_POSITION_VECTOR, MAX_CARRY ), DEFINE_ARRAY( COsprey, m_hRepel, FIELD_EHANDLE, 4 ), // DEFINE_FIELD( COsprey, m_iSoundState, FIELD_INTEGER ), // DEFINE_FIELD( COsprey, m_iSpriteTexture, FIELD_INTEGER ), // DEFINE_FIELD( COsprey, m_iPitch, FIELD_INTEGER ), DEFINE_FIELD( COsprey, m_iDoLeftSmokePuff, FIELD_INTEGER ), DEFINE_FIELD( COsprey, m_iDoRightSmokePuff, FIELD_INTEGER ), }; IMPLEMENT_SAVERESTORE( COsprey, CBaseMonster ); void COsprey :: Spawn( void ) { Precache( );
float m_streakTime; // streak timer (don't send too many) float m_flameX; // Flame thrower aim float m_flameY; }; LINK_ENTITY_TO_CLASS( monster_gargantua, CGargantua ); TYPEDESCRIPTION CGargantua::m_SaveData[] = { DEFINE_FIELD( CGargantua, m_pEyeGlow, FIELD_CLASSPTR ), DEFINE_FIELD( CGargantua, m_eyeBrightness, FIELD_INTEGER ), DEFINE_FIELD( CGargantua, m_seeTime, FIELD_TIME ), DEFINE_FIELD( CGargantua, m_flameTime, FIELD_TIME ), DEFINE_FIELD( CGargantua, m_streakTime, FIELD_TIME ), DEFINE_FIELD( CGargantua, m_painSoundTime, FIELD_TIME ), DEFINE_ARRAY( CGargantua, m_pFlame, FIELD_CLASSPTR, 4 ), DEFINE_FIELD( CGargantua, m_flameX, FIELD_FLOAT ), DEFINE_FIELD( CGargantua, m_flameY, FIELD_FLOAT ), }; IMPLEMENT_SAVERESTORE( CGargantua, CBaseMonster ); const char *CGargantua::pAttackHitSounds[] = { "zombie/claw_strike1.wav", "zombie/claw_strike2.wav", "zombie/claw_strike3.wav", }; const char *CGargantua::pBeamAttackSounds[] = {
void FlushChanges( void ); void KeyValue(struct KeyValueData_s *); //AJH virtual int Save( CSave &save ); virtual int Restore( CRestore &restore ); static TYPEDESCRIPTION m_SaveData[]; }; LINK_ENTITY_TO_CLASS( info_alias, CInfoAlias ); TYPEDESCRIPTION CInfoAlias::m_SaveData[] = //AJH { DEFINE_FIELD( CInfoAlias, m_cTargets, FIELD_INTEGER ), DEFINE_FIELD( CInfoAlias, m_iMode, FIELD_INTEGER ), DEFINE_FIELD( CInfoAlias, m_iCurrentTarget, FIELD_INTEGER ), DEFINE_ARRAY( CInfoAlias, m_iTargetName, FIELD_STRING, MAX_ALIAS_TARGETS ), // DEFINE_FIELD( CInfoAlias, m_pNextAlias, FIELD_CLASSPTR ), }; IMPLEMENT_SAVERESTORE( CInfoAlias, CBaseAlias ); void CInfoAlias :: KeyValue( KeyValueData *pkvd ) //AJH { if (FStrEq(pkvd->szKeyName, "mode")) { m_iMode = atoi( pkvd->szValue ); pkvd->fHandled = TRUE; } else if (FStrEq(pkvd->szKeyName, "targetname")) { pev->targetname = ALLOC_STRING( pkvd->szValue );
#include "precompiled.h" /* * Globals initialization */ #ifndef HOOK_GAMEDLL TYPEDESCRIPTION CFuncWeaponCheck::m_SaveData[] = { DEFINE_FIELD(CFuncWeaponCheck, sTriggerWithItems, FIELD_STRING), DEFINE_FIELD(CFuncWeaponCheck, sTriggerNoItems, FIELD_STRING), DEFINE_FIELD(CFuncWeaponCheck, iItemCount, FIELD_INTEGER), DEFINE_ARRAY(CFuncWeaponCheck, sMaster, FIELD_STRING, MAX_ITEM_COUNTS), DEFINE_FIELD(CFuncWeaponCheck, sItemName, FIELD_STRING), DEFINE_FIELD(CFuncWeaponCheck, iAnyWeapon, FIELD_INTEGER), }; TYPEDESCRIPTION CBaseGrenCatch::m_SaveData[] = { DEFINE_FIELD(CBaseGrenCatch, m_NeedGrenadeType, FIELD_INTEGER), DEFINE_FIELD(CBaseGrenCatch, m_fSmokeTouching, FIELD_BOOLEAN), DEFINE_FIELD(CBaseGrenCatch, m_fFlashTouched, FIELD_BOOLEAN), DEFINE_FIELD(CBaseGrenCatch, sTriggerOnGrenade, FIELD_STRING), DEFINE_FIELD(CBaseGrenCatch, sDisableOnGrenade, FIELD_STRING), }; #endif // HOOK_GAMEDLL /* <18bcc4> ../cstrike/dlls/training_gamerules.cpp:23 */ CHalfLifeTraining::CHalfLifeTraining() {
#include "precompiled.h" /* * Globals initialization */ #ifndef HOOK_GAMEDLL TYPEDESCRIPTION CRuleEntity::m_SaveData[] = { DEFINE_FIELD(CRuleEntity, m_iszMaster, FIELD_STRING), }; TYPEDESCRIPTION CGameText::m_SaveData[] = { DEFINE_ARRAY(CGameText, m_textParms, FIELD_CHARACTER, sizeof(hudtextparms_t)), }; TYPEDESCRIPTION CGamePlayerZone::m_SaveData[] = { DEFINE_FIELD(CGamePlayerZone, m_iszInTarget, FIELD_STRING), DEFINE_FIELD(CGamePlayerZone, m_iszOutTarget, FIELD_STRING), DEFINE_FIELD(CGamePlayerZone, m_iszInCount, FIELD_STRING), DEFINE_FIELD(CGamePlayerZone, m_iszOutCount, FIELD_STRING), }; #else TYPEDESCRIPTION (*CRuleEntity::pm_SaveData)[1]; TYPEDESCRIPTION (*CGameText::pm_SaveData)[1]; TYPEDESCRIPTION (*CGamePlayerZone::pm_SaveData)[4];