Browse Source

Fix build.

dmc
Night Owl 8 years ago
parent
commit
ecf322b729
  1. 3
      cl_dll/battery.cpp
  2. 10
      cl_dll/death.cpp
  3. 5
      cl_dll/dmc/DMC_Teleporters.cpp
  4. 3
      cl_dll/flashlight.cpp
  5. 2
      cl_dll/health.cpp
  6. 10
      cl_dll/hud.cpp
  7. 2
      cl_dll/hud.h
  8. 8
      cl_dll/hud_spectator.cpp
  9. 6
      cl_dll/quake/quake_baseentity.cpp
  10. 2
      cl_dll/quake/quake_weapons.cpp
  11. 4
      common/bspfile.h
  12. 20
      dlls/client.cpp
  13. 15
      dlls/dmc/quake_items.cpp
  14. 4
      dlls/dmc/quake_nail.cpp
  15. 10
      dlls/dmc/quake_rocket.cpp
  16. 34
      dlls/doors.cpp
  17. 2
      dlls/gamerules.h
  18. 176
      dlls/monsterstate.cpp
  19. 101
      dlls/player.cpp
  20. 1483
      dlls/schedule.cpp
  21. 6
      dlls/triggers.cpp
  22. 8
      dlls/weapons.cpp
  23. 6
      dlls/weapons.h
  24. 1
      dlls/world.cpp

3
cl_dll/battery.cpp

@ -82,9 +82,6 @@ int CHudBattery::Draw( float flTime ) @@ -82,9 +82,6 @@ int CHudBattery::Draw( float flTime )
UnpackRGB( r, g, b, RGB_YELLOWISH );
if( !( gHUD.m_iWeaponBits & ( 1 << ( 4096 ) ) ) )
return 1;
// Has health changed? Flash the health #
if( m_fFade )
{

10
cl_dll/death.cpp

@ -161,13 +161,9 @@ int CHudDeathNotice::Draw( float flTime ) @@ -161,13 +161,9 @@ int CHudDeathNotice::Draw( float flTime )
x += ( gHUD.GetSpriteRect(id).right - gHUD.GetSpriteRect(id).left );
// Draw victims name (if it was a player that was killed)
if( rgDeathNoticeList[i].iNonPlayerKill == FALSE )
{
if( rgDeathNoticeList[i].VictimColor )
DrawSetTextColor( rgDeathNoticeList[i].VictimColor[0], rgDeathNoticeList[i].VictimColor[1], rgDeathNoticeList[i].VictimColor[2] );
x = DrawConsoleString( x, y, rgDeathNoticeList[i].szVictim );
}
if( rgDeathNoticeList[i].VictimColor )
DrawSetTextColor( rgDeathNoticeList[i].VictimColor[0], rgDeathNoticeList[i].VictimColor[1], rgDeathNoticeList[i].VictimColor[2] );
x = DrawConsoleString( x, y, rgDeathNoticeList[i].szVictim );
}
}

5
cl_dll/dmc/DMC_Teleporters.cpp

@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
// $NoKeywords: $
//=============================================================================
#include "extdll.h"
#include "hud.h"
#include "entity_state.h"
#include "pm_defs.h"
#include "pm_shared.h"
@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
#include "event_flags.h"
#include "DMC_BSPFile.h"
#include "cl_util.h"
#include <string.h>
extern "C" playermove_t *pmove;
extern int g_runfuncs;
@ -513,4 +514,4 @@ void Dmc_CheckTeleporters( struct local_state_s *from, struct local_state_s *to @@ -513,4 +514,4 @@ void Dmc_CheckTeleporters( struct local_state_s *from, struct local_state_s *to
// Run test
if ( g_iUser1 == OBS_NONE )
Dmc_TouchTeleporters( to, s_teles, s_num_teles );
}
}

3
cl_dll/flashlight.cpp

@ -106,9 +106,6 @@ int CHudFlashlight::Draw( float flTime ) @@ -106,9 +106,6 @@ int CHudFlashlight::Draw( float flTime )
int r, g, b, x, y, a;
wrect_t rc;
if( !( gHUD.m_iWeaponBits & ( 1 << ( 4096 ) ) ) )
return 1;
if( m_fOn )
a = 225;
else

2
cl_dll/health.cpp

@ -211,8 +211,6 @@ int CHudHealth::Draw( float flTime ) @@ -211,8 +211,6 @@ int CHudHealth::Draw( float flTime )
GetPainColor( r, g, b );
ScaleColors( r, g, b, a );
// Only draw health if we have the suit.
if( gHUD.m_iWeaponBits & ( 1 << ( 4096 ) ) )
{
HealthWidth = gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).right - gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).left;
int CrossWidth = gHUD.GetSpriteRect( m_HUD_cross ).right - gHUD.GetSpriteRect( m_HUD_cross ).left;

10
cl_dll/hud.cpp

@ -90,11 +90,6 @@ int __MsgFunc_QItems( const char *pszName, int iSize, void *pbuf ) @@ -90,11 +90,6 @@ int __MsgFunc_QItems( const char *pszName, int iSize, void *pbuf )
return gHUD.MsgFunc_QItems( pszName, iSize, pbuf );
}
int __MsgFunc_ScoreInfo( const char *pszName, int iSize, void *pbuf )
{
return 0;
}
// This is called every time the DLL is loaded
void CHud::Init( void )
{
@ -111,9 +106,6 @@ void CHud::Init( void ) @@ -111,9 +106,6 @@ void CHud::Init( void )
// QUAKECLASSIC
HOOK_MESSAGE( QItems );
HOOK_MESSAGE( ScoreInfo );
//HOOK_MESSAGE( TeamScore );
HOOK_MESSAGE( TeamInfo );
hud_textmode = CVAR_CREATE ( "hud_textmode", "0", FCVAR_ARCHIVE );
m_iLogo = 0;
@ -324,7 +316,7 @@ void CHud::VidInit( void ) @@ -324,7 +316,7 @@ void CHud::VidInit( void )
m_Geiger.VidInit();
m_Train.VidInit();
m_Battery.VidInit();
m_Flash.VidInit();
//m_Flash.VidInit();
m_Message.VidInit();
m_StatusBar.VidInit();
m_DeathNotice.VidInit();

2
cl_dll/hud.h

@ -611,7 +611,7 @@ public: @@ -611,7 +611,7 @@ public:
int m_iFontHeight;
int DrawHudNumber( int x, int y, int iFlags, int iNumber, int r, int g, int b );
int DrawHudString( int x, int y, int iMaxX, char *szString, int r, int g, int b );
int DrawHudStringCTFint x, int y, int iMaxX, char *szString, int r, int g, int b );
int DrawHudStringCTF( int x, int y, int iMaxX, char *szString, int r, int g, int b );
int ReturnStringPixelLength( char *Hihi );
int DrawHudStringReverse( int xpos, int ypos, int iMinX, char *szString, int r, int g, int b );
int DrawHudNumberString( int xpos, int ypos, int iMinX, int iNumber, int r, int g, int b );

8
cl_dll/hud_spectator.cpp

@ -76,6 +76,7 @@ void SpectatorSpray( void ) @@ -76,6 +76,7 @@ void SpectatorSpray( void )
gEngfuncs.pfnServerCmd( string );
}
}
void SpectatorHelp( void )
{
{
@ -1401,13 +1402,6 @@ void CHudSpectator::CheckSettings() @@ -1401,13 +1402,6 @@ void CHudSpectator::CheckSettings()
}
}
// if we are a real player on server don't allow inset window
// in First Person mode since this is our resticted forcecamera mode 2
// team number 3 = SPECTATOR see player.h
if( ( ( g_iTeamNumber == 1 ) || ( g_iTeamNumber == 2 ) ) && ( g_iUser1 == OBS_IN_EYE ) )
m_pip->value = INSET_OFF;
// draw small border around inset view, adjust upper black bar
}

6
cl_dll/quake/quake_baseentity.cpp

@ -239,8 +239,8 @@ void CBasePlayer::PlayerUse ( void ) { } @@ -239,8 +239,8 @@ void CBasePlayer::PlayerUse ( void ) { }
void CBasePlayer::Jump() { }
void CBasePlayer::Duck( ) { }
int CBasePlayer::Classify ( void ) { return 0; }
void CBasePlayer :: PlayStepSound(int step, float fvol) { }
void CBasePlayer :: UpdateStepSound( void ) { }
//void CBasePlayer :: PlayStepSound(int step, float fvol) { }
//void CBasePlayer :: UpdateStepSound( void ) { }
void CBasePlayer::PreThink(void) { }
void CBasePlayer::CheckTimeBasedDamage() { }
void CBasePlayer :: UpdateGeigerCounter( void ) { }
@ -327,4 +327,4 @@ void CBasePlayerAmmo::Materialize( void ) { } @@ -327,4 +327,4 @@ void CBasePlayerAmmo::Materialize( void ) { }
void CBasePlayerAmmo :: DefaultTouch( CBaseEntity *pOther ) { }
int CBasePlayerWeapon::ExtractAmmo( CBasePlayerWeapon *pWeapon ) { return 0; }
int CBasePlayerWeapon::ExtractClipAmmo( CBasePlayerWeapon *pWeapon ) { return 0; }
void CBasePlayerWeapon::RetireWeapon( void ) { }
void CBasePlayerWeapon::RetireWeapon( void ) { }

2
cl_dll/quake/quake_weapons.cpp

@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
#include "../demo.h"
#include "quake_gun.h"
#include "../DMC_Teleporters.h"
#include "DMC_Teleporters.h"
extern globalvars_t *gpGlobals;

4
common/bspfile.h

@ -131,13 +131,13 @@ typedef struct @@ -131,13 +131,13 @@ typedef struct
int fileofs;
int filelen;
} dlump_t;
/*
typedef struct
{
int version;
dlump_t lumps[HEADER_LUMPS];
} dheader_t;
*/
typedef struct
{
int version;

20
dlls/client.cpp

@ -431,11 +431,15 @@ void ClientCommand( edict_t *pEntity ) @@ -431,11 +431,15 @@ void ClientCommand( edict_t *pEntity )
}
}
}
else if( pPlayer->m_bHadFirstSpawn == false && g_bHaveMOTD )
{
pPlayer->m_bHadFirstSpawn = true;
pPlayer->Spawn();
}
else if( FStrEq( pcmd, "_firstspawn" ) )
{
CBasePlayer *pPlayer = GetClassPtr( (CBasePlayer *)pev );
if( pPlayer->m_bHadFirstSpawn == false && g_bHaveMOTD )
{
pPlayer->m_bHadFirstSpawn = true;
pPlayer->Spawn();
}
}
else if( FStrEq( pcmd, "lastinv" ) )
{
GetClassPtr( (CBasePlayer *)pev )->SelectLastItem();
@ -1691,12 +1695,6 @@ void UpdateClientData( const struct edict_s *ent, int sendweapons, struct client @@ -1691,12 +1695,6 @@ void UpdateClientData( const struct edict_s *ent, int sendweapons, struct client
cd->vuser4.x = gun->m_iPrimaryAmmoType;
cd->vuser4.y = pl->m_rgAmmo[gun->m_iPrimaryAmmoType];
cd->vuser4.z = pl->m_rgAmmo[gun->m_iSecondaryAmmoType];
if( pl->m_pActiveItem->m_iId == WEAPON_RPG )
{
cd->vuser2.y = ( (CRpg *)pl->m_pActiveItem )->m_fSpotActive;
cd->vuser2.z = ( (CRpg *)pl->m_pActiveItem )->m_cActiveRockets;
}
}
}
cd->fuser1 = (float)pl->m_iQuakeWeapon;

15
dlls/dmc/quake_items.cpp

@ -61,7 +61,7 @@ void CQuakeItem::Spawn() @@ -61,7 +61,7 @@ void CQuakeItem::Spawn()
pev->movetype = MOVETYPE_TOSS;
pev->solid = SOLID_TRIGGER;
SetTouch(ItemTouch);
SetTouch( &CQuakeItem::ItemTouch );
if (DROP_TO_FLOOR(ENT(pev)) == 0)
{
@ -83,7 +83,7 @@ void CQuakeItem::Materialize() @@ -83,7 +83,7 @@ void CQuakeItem::Materialize()
{
// Become visible and touchable
pev->effects &= ~EF_NODRAW;
SetTouch( ItemTouch );
SetTouch( &CQuakeItem::ItemTouch );
// Play respawn sound
EMIT_SOUND( ENT(pev), CHAN_WEAPON, "items/itembk2.wav", 1, ATTN_NORM );
@ -98,11 +98,10 @@ void CQuakeItem::Respawn( float flTime ) @@ -98,11 +98,10 @@ void CQuakeItem::Respawn( float flTime )
SetTouch( NULL );
// Come back in time
SetThink ( Materialize );
SetThink( &CQuakeItem::Materialize );
pev->nextthink = gpGlobals->time + flTime;
}
//-----------------------------------------------------------------------------
// Purpose: Touch function that calls the virtual touch function
//-----------------------------------------------------------------------------
@ -238,7 +237,7 @@ BOOL CItemHealth::MyTouch( CBasePlayer *pPlayer ) @@ -238,7 +237,7 @@ BOOL CItemHealth::MyTouch( CBasePlayer *pPlayer )
pPlayer->m_iQuakeItems |= IT_SUPERHEALTH;
if (gpGlobals->deathmatch != 4)
{
SetThink( MegahealthRot );
SetThink( &CItemHealth::MegahealthRot );
pev->nextthink = gpGlobals->time + 5;
}
m_hRotTarget = pPlayer;
@ -272,7 +271,7 @@ void CItemHealth::MegahealthRot( void ) @@ -272,7 +271,7 @@ void CItemHealth::MegahealthRot( void )
// Respawn if it's not DM==2
if (gpGlobals->deathmatch != 2)
{
SetThink ( Materialize );
SetThink( &CQuakeItem::Materialize );
pev->nextthink = gpGlobals->time + 20;
}
else
@ -1356,7 +1355,7 @@ void CItemBackpack::Spawn() @@ -1356,7 +1355,7 @@ void CItemBackpack::Spawn()
UTIL_SetOrigin( pev, pev->origin );
SET_MODEL(ENT(pev), "models/backpack.mdl");
SetTouch(ItemTouch);
SetTouch( &CItemBackpack::ItemTouch );
}
// Drop a backpack containing this player's ammo/weapons
@ -1406,7 +1405,7 @@ void CBasePlayer::DropBackpack() @@ -1406,7 +1405,7 @@ void CBasePlayer::DropBackpack()
// Remove after 2 mins
pPack->pev->nextthink = gpGlobals->time + 120;
pPack->SetThink( SUB_Remove );
pPack->SetThink( &CBasePlayer::SUB_Remove );
// Remove all weapons
m_iQuakeItems = 0;

4
dlls/dmc/quake_nail.cpp

@ -65,10 +65,10 @@ void CQuakeNail::Spawn( void ) @@ -65,10 +65,10 @@ void CQuakeNail::Spawn( void )
// Safety removal
pev->nextthink = gpGlobals->time + 6;
SetThink( SUB_Remove );
SetThink( &CBaseEntity::SUB_Remove );
// Touch
SetTouch( NailTouch );
SetTouch( &CQuakeNail::NailTouch );
// Model
SET_MODEL( ENT(pev), "models/spike.mdl" );

10
dlls/dmc/quake_rocket.cpp

@ -49,11 +49,11 @@ CQuakeRocket *CQuakeRocket::CreateRocket( Vector vecOrigin, Vector vecAngles, CB @@ -49,11 +49,11 @@ CQuakeRocket *CQuakeRocket::CreateRocket( Vector vecOrigin, Vector vecAngles, CB
pRocket->pev->angles = UTIL_VecToAngles( vecAngles );
// Touch
pRocket->SetTouch( CQuakeRocket::RocketTouch );
pRocket->SetTouch( &CQuakeRocket::RocketTouch );
// Safety Remove
pRocket->pev->nextthink = gpGlobals->time + 5;
pRocket->SetThink( SUB_Remove );
pRocket->SetThink( &CBaseEntity::SUB_Remove );
// Effects
// pRocket->pev->effects |= EF_LIGHT;
@ -87,7 +87,7 @@ CQuakeRocket *CQuakeRocket::CreateGrenade( Vector vecOrigin, Vector vecVelocity, @@ -87,7 +87,7 @@ CQuakeRocket *CQuakeRocket::CreateGrenade( Vector vecOrigin, Vector vecVelocity,
pRocket->pev->friction = 0.5;
// Touch
pRocket->SetTouch( CQuakeRocket::GrenadeTouch );
pRocket->SetTouch( &CQuakeRocket::GrenadeTouch );
// set newmis duration
if ( gpGlobals->deathmatch == 4 )
@ -98,7 +98,7 @@ CQuakeRocket *CQuakeRocket::CreateGrenade( Vector vecOrigin, Vector vecVelocity, @@ -98,7 +98,7 @@ CQuakeRocket *CQuakeRocket::CreateGrenade( Vector vecOrigin, Vector vecVelocity,
}
pRocket->pev->nextthink = gpGlobals->time + 2.5;
pRocket->SetThink( CQuakeRocket::GrenadeExplode );
pRocket->SetThink( &CQuakeRocket::GrenadeExplode );
PLAYBACK_EVENT_FULL (FEV_GLOBAL, pRocket->edict(), g_sTrail, 0.0,
(float *)&g_vecZero, (float *)&g_vecZero, 0.7, 0.0, pRocket->entindex(), GRENADE_TRAIL, 0, 0);
@ -188,4 +188,4 @@ void CQuakeRocket::Explode() @@ -188,4 +188,4 @@ void CQuakeRocket::Explode()
PLAYBACK_EVENT_FULL( FEV_GLOBAL, edict(), g_sExplosion, 0.0, (float *)&pev->origin, (float *)&pev->velocity, 0.0, 0.0, 0, 0, 0, 0 );
UTIL_Remove( this );
}
}

34
dlls/doors.cpp

@ -632,18 +632,20 @@ void CBaseDoor::DoorGoUp( void ) @@ -632,18 +632,20 @@ void CBaseDoor::DoorGoUp( void )
// emit door moving and stop sounds on CHAN_STATIC so that the multicast doesn't
// filter them out and leave a client stuck with looping door sounds!
if( !FBitSet( pev->spawnflags, SF_DOOR_SILENT ) && m_bIsReopening == false )
{
// don't play sounds too often
if( m_fNextSoundPlay < gpGlobals->time )
{
// don't play sounds too often
if( m_fNextSoundPlay < gpGlobals->time )
{
PLAYBACK_EVENT_FULL( FEV_RELIABLE, NULL, m_usDoorGoUp, 0.0, (float *)&Center(), (float *)&g_vecZero, 0.0, 0.0, ( m_bMoveSnd << 8 ) | ( m_bStopSnd & 0xff ), 0, 0, 0 );
Vector vecCenter( Center() );
float *pCenter = (float *)&vecCenter;
PLAYBACK_EVENT_FULL( FEV_RELIABLE, NULL, m_usDoorGoUp, 0.0, pCenter, (float *)&g_vecZero, 0.0, 0.0, ( m_bMoveSnd << 8 ) | ( m_bStopSnd & 0xff ), 0, 0, 0 );
#if defined ( OLD_SOUNDS )
STOP_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMoving ) );
if( m_toggle_state != TS_GOING_UP && m_toggle_state != TS_GOING_DOWN )
EMIT_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMoving ), 1, ATTN_NORM );
STOP_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMoving ) );
if( m_toggle_state != TS_GOING_UP && m_toggle_state != TS_GOING_DOWN )
EMIT_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMoving ), 1, ATTN_NORM );
#endif
}
}
}
m_toggle_state = TS_GOING_UP;
SetMoveDone( &CBaseDoor::DoorHitTop );
@ -686,8 +688,9 @@ void CBaseDoor::DoorHitTop( void ) @@ -686,8 +688,9 @@ void CBaseDoor::DoorHitTop( void )
if( ( ( m_fNextSoundPlay < gpGlobals->time ) && !m_bIsReopening ) || ( !m_bStoppedOpenSound ) )
{
m_bStoppedOpenSound = true;
PLAYBACK_EVENT_FULL( FEV_RELIABLE, NULL, m_usDoorHitTop, 0.0, (float *)&Center(), (float *)&g_vecZero, 0.0, 0.0, ( m_bMoveSnd << 8 ) | ( m_bStopSnd & 0xff ), 0, 0, 0 );
Vector vecCenter( Center() );
float *pCenter = (float *)&vecCenter;
PLAYBACK_EVENT_FULL( FEV_RELIABLE, NULL, m_usDoorHitTop, 0.0, pCenter, (float *)&g_vecZero, 0.0, 0.0, ( m_bMoveSnd << 8 ) | ( m_bStopSnd & 0xff ), 0, 0, 0 );
#if defined ( OLD_SOUNDS )
STOP_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMoving ) );
@ -736,13 +739,16 @@ void CBaseDoor::DoorGoDown( void ) @@ -736,13 +739,16 @@ void CBaseDoor::DoorGoDown( void )
// don't play sounds too often
if( m_fNextSoundPlay < gpGlobals->time )
{
PLAYBACK_EVENT_FULL( FEV_RELIABLE, NULL, m_usDoorGoDown, 0.0, (float *)&Center(), (float *)&g_vecZero, 0.0, 0.0, ( m_bMoveSnd << 8 ) | ( m_bStopSnd & 0xff ), 0, 0, 0 );
Vector vecCenter( Center() );
float *pCenter = (float *)&vecCenter;
PLAYBACK_EVENT_FULL( FEV_RELIABLE, NULL, m_usDoorGoDown, 0.0, pCenter, (float *)&g_vecZero, 0.0, 0.0, ( m_bMoveSnd << 8 ) | ( m_bStopSnd & 0xff ), 0, 0, 0 );
#if defined ( OLD_SOUNDS )
STOP_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMoving ) );
if( m_toggle_state != TS_GOING_UP && m_toggle_state != TS_GOING_DOWN )
EMIT_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMoving ), 1, ATTN_NORM );
#endif
}
}
#ifdef DOOR_ASSERT
ASSERT( m_toggle_state == TS_AT_TOP );
#endif // DOOR_ASSERT
@ -765,7 +771,9 @@ void CBaseDoor::DoorHitBottom( void ) @@ -765,7 +771,9 @@ void CBaseDoor::DoorHitBottom( void )
// don't play sounds too often
if( m_fNextSoundPlay < gpGlobals->time )
{
PLAYBACK_EVENT_FULL( FEV_RELIABLE, NULL, m_usDoorHitBottom, 0.0, (float *)&Center(), (float *)&g_vecZero, 0.0, 0.0, ( m_bMoveSnd << 8 ) | ( m_bStopSnd & 0xff ), 0, 0, 0 );
Vector vecCenter( Center() );
float *pCenter = (float *)&vecCenter;
PLAYBACK_EVENT_FULL( FEV_RELIABLE, NULL, m_usDoorHitBottom, 0.0, pCenter, (float *)&g_vecZero, 0.0, 0.0, ( m_bMoveSnd << 8 ) | ( m_bStopSnd & 0xff ), 0, 0, 0 );
#if defined ( OLD_SOUNDS )
STOP_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMoving ) );
EMIT_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseArrived ), 1, ATTN_NORM );

2
dlls/gamerules.h

@ -260,8 +260,6 @@ class CHalfLifeMultiplay : public CGameRules @@ -260,8 +260,6 @@ class CHalfLifeMultiplay : public CGameRules
public:
CHalfLifeMultiplay();
virtual BOOL ClientCommand( CBasePlayer *pPlayer, const char *pcmd );
// GR_Think
virtual void Think( void );
virtual void RefreshSkillData( void );

176
dlls/monsterstate.cpp

@ -55,179 +55,3 @@ void CBaseMonster::SetState( MONSTERSTATE State ) @@ -55,179 +55,3 @@ void CBaseMonster::SetState( MONSTERSTATE State )
m_MonsterState = State;
m_IdealMonsterState = State;
}
//=========================================================
// RunAI
//=========================================================
void CBaseMonster::RunAI( void )
{
// to test model's eye height
//UTIL_ParticleEffect ( pev->origin + pev->view_ofs, g_vecZero, 255, 10 );
// IDLE sound permitted in ALERT state is because monsters were silent in ALERT state. Only play IDLE sound in IDLE state
// once we have sounds for that state.
if( ( m_MonsterState == MONSTERSTATE_IDLE || m_MonsterState == MONSTERSTATE_ALERT ) && RANDOM_LONG( 0, 99 ) == 0 && !( pev->flags & SF_MONSTER_GAG ) )
{
IdleSound();
}
if( m_MonsterState != MONSTERSTATE_NONE &&
m_MonsterState != MONSTERSTATE_PRONE &&
m_MonsterState != MONSTERSTATE_DEAD )// don't bother with this crap if monster is prone.
{
// collect some sensory Condition information.
// don't let monsters outside of the player's PVS act up, or most of the interesting
// things will happen before the player gets there!
// UPDATE: We now let COMBAT state monsters think and act fully outside of player PVS. This allows the player to leave
// an area where monsters are fighting, and the fight will continue.
if( !FNullEnt( FIND_CLIENT_IN_PVS( edict() ) ) || ( m_MonsterState == MONSTERSTATE_COMBAT ) )
{
Look( m_flDistLook );
Listen();// check for audible sounds.
// now filter conditions.
ClearConditions( IgnoreConditions() );
GetEnemy();
}
// do these calculations if monster has an enemy.
if( m_hEnemy != NULL )
{
CheckEnemy( m_hEnemy );
}
CheckAmmo();
}
FCheckAITrigger();
PrescheduleThink();
MaintainSchedule();
// if the monster didn't use these conditions during the above call to MaintainSchedule() or CheckAITrigger()
// we throw them out cause we don't want them sitting around through the lifespan of a schedule
// that doesn't use them.
m_afConditions &= ~( bits_COND_LIGHT_DAMAGE | bits_COND_HEAVY_DAMAGE );
}
//=========================================================
// GetIdealState - surveys the Conditions information available
// and finds the best new state for a monster.
//=========================================================
MONSTERSTATE CBaseMonster::GetIdealState( void )
{
int iConditions;
iConditions = IScheduleFlags();
// If no schedule conditions, the new ideal state is probably the reason we're in here.
switch( m_MonsterState )
{
case MONSTERSTATE_IDLE:
/*
IDLE goes to ALERT upon hearing a sound
-IDLE goes to ALERT upon being injured
IDLE goes to ALERT upon seeing food
-IDLE goes to COMBAT upon sighting an enemy
IDLE goes to HUNT upon smelling food
*/
{
if( iConditions & bits_COND_NEW_ENEMY )
{
// new enemy! This means an idle monster has seen someone it dislikes, or
// that a monster in combat has found a more suitable target to attack
m_IdealMonsterState = MONSTERSTATE_COMBAT;
}
else if( iConditions & bits_COND_LIGHT_DAMAGE )
{
MakeIdealYaw( m_vecEnemyLKP );
m_IdealMonsterState = MONSTERSTATE_ALERT;
}
else if( iConditions & bits_COND_HEAVY_DAMAGE )
{
MakeIdealYaw( m_vecEnemyLKP );
m_IdealMonsterState = MONSTERSTATE_ALERT;
}
else if( iConditions & bits_COND_HEAR_SOUND )
{
CSound *pSound;
pSound = PBestSound();
ASSERT( pSound != NULL );
if( pSound )
{
MakeIdealYaw( pSound->m_vecOrigin );
if( pSound->m_iType & ( bits_SOUND_COMBAT|bits_SOUND_DANGER ) )
m_IdealMonsterState = MONSTERSTATE_ALERT;
}
}
else if( iConditions & ( bits_COND_SMELL | bits_COND_SMELL_FOOD ) )
{
m_IdealMonsterState = MONSTERSTATE_ALERT;
}
break;
}
case MONSTERSTATE_ALERT:
/*
ALERT goes to IDLE upon becoming bored
-ALERT goes to COMBAT upon sighting an enemy
ALERT goes to HUNT upon hearing a noise
*/
{
if( iConditions & ( bits_COND_NEW_ENEMY | bits_COND_SEE_ENEMY ) )
{
// see an enemy we MUST attack
m_IdealMonsterState = MONSTERSTATE_COMBAT;
}
else if( iConditions & bits_COND_HEAR_SOUND )
{
m_IdealMonsterState = MONSTERSTATE_ALERT;
CSound *pSound = PBestSound();
ASSERT( pSound != NULL );
if( pSound )
MakeIdealYaw( pSound->m_vecOrigin );
}
break;
}
case MONSTERSTATE_COMBAT:
/*
COMBAT goes to HUNT upon losing sight of enemy
COMBAT goes to ALERT upon death of enemy
*/
{
if( m_hEnemy == NULL )
{
m_IdealMonsterState = MONSTERSTATE_ALERT;
// pev->effects = EF_BRIGHTFIELD;
ALERT( at_aiconsole, "***Combat state with no enemy!\n" );
}
break;
}
case MONSTERSTATE_HUNT:
/*
HUNT goes to ALERT upon seeing food
HUNT goes to ALERT upon being injured
HUNT goes to IDLE if goal touched
HUNT goes to COMBAT upon seeing enemy
*/
{
break;
}
case MONSTERSTATE_SCRIPT:
if( iConditions & ( bits_COND_TASK_FAILED | bits_COND_LIGHT_DAMAGE | bits_COND_HEAVY_DAMAGE ) )
{
ExitScriptedSequence(); // This will set the ideal state
}
break;
case MONSTERSTATE_DEAD:
m_IdealMonsterState = MONSTERSTATE_DEAD;
break;
default:
break;
}
return m_IdealMonsterState;
}

101
dlls/player.cpp

@ -220,7 +220,7 @@ void LinkUserMessages( void ) @@ -220,7 +220,7 @@ void LinkUserMessages( void )
gmsgInitHUD = REG_USER_MSG( "InitHUD", -1 ); // called every time a new player joins the server
gmsgShowGameTitle = REG_USER_MSG( "GameTitle", 1 );
gmsgDeathMsg = REG_USER_MSG( "DeathMsg", -1 );
gmsgScoreInfo = REG_USER_MSG( "ScoreInfo", 7 );
gmsgScoreInfo = REG_USER_MSG( "ScoreInfo", 9 );
gmsgTeamInfo = REG_USER_MSG( "TeamInfo", -1 ); // sets the name of a player's team
gmsgTeamScore = REG_USER_MSG( "TeamScore", -1 ); // sets the score of a team on the scoreboard
gmsgGameMode = REG_USER_MSG( "GameMode", 1 );
@ -246,7 +246,7 @@ void LinkUserMessages( void ) @@ -246,7 +246,7 @@ void LinkUserMessages( void )
LINK_ENTITY_TO_CLASS( player, CBasePlayer )
// QUAKECLASSIC: Play pain sounds
void CBasePlayer::Pain( void )
void CBasePlayer::Pain( CBaseEntity *pAttacker )
{
if( pev->health < 0 )
return;
@ -1336,103 +1336,6 @@ void CBasePlayer::AddPointsToTeam( int score, BOOL bAllowNegativeScore ) @@ -1336,103 +1336,6 @@ void CBasePlayer::AddPointsToTeam( int score, BOOL bAllowNegativeScore )
}
}
//Player ID
void CBasePlayer::InitStatusBar()
{
m_flStatusBarDisappearDelay = 0;
m_SbarString1[0] = m_SbarString0[0] = 0;
}
void CBasePlayer::UpdateStatusBar()
{
int newSBarState[SBAR_END] = {0};
char sbuf0[SBAR_STRING_SIZE];
char sbuf1[ SBAR_STRING_SIZE ];
strcpy( sbuf0, m_SbarString0 );
strcpy( sbuf1, m_SbarString1 );
// Find an ID Target
TraceResult tr;
UTIL_MakeVectors( pev->v_angle + pev->punchangle );
Vector vecSrc = EyePosition();
Vector vecEnd = vecSrc + ( gpGlobals->v_forward * MAX_ID_RANGE );
UTIL_TraceLine( vecSrc, vecEnd, dont_ignore_monsters, edict(), &tr );
if( tr.flFraction != 1.0 )
{
if( !FNullEnt( tr.pHit ) )
{
CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit );
if( pEntity->Classify() == CLASS_PLAYER )
{
newSBarState[SBAR_ID_TARGETNAME] = ENTINDEX( pEntity->edict() );
strcpy( sbuf1, "1 %p1\n2 Health: %i2%%\n3 Armor: %i3%%" );
// allies and medics get to see the targets health
if( g_pGameRules->PlayerRelationship( this, pEntity ) == GR_TEAMMATE )
{
newSBarState[SBAR_ID_TARGETHEALTH] = 100 * ( pEntity->pev->health / pEntity->pev->max_health );
newSBarState[SBAR_ID_TARGETARMOR] = pEntity->pev->armorvalue; //No need to get it % based since 100 it's the max.
}
m_flStatusBarDisappearDelay = gpGlobals->time + 1.0;
}
}
else if( m_flStatusBarDisappearDelay > gpGlobals->time )
{
// hold the values for a short amount of time after viewing the object
newSBarState[SBAR_ID_TARGETNAME] = m_izSBarState[SBAR_ID_TARGETNAME];
newSBarState[SBAR_ID_TARGETHEALTH] = m_izSBarState[SBAR_ID_TARGETHEALTH];
newSBarState[SBAR_ID_TARGETARMOR] = m_izSBarState[SBAR_ID_TARGETARMOR];
}
}
BOOL bForceResend = FALSE;
if( strcmp( sbuf0, m_SbarString0 ) )
{
MESSAGE_BEGIN( MSG_ONE, gmsgStatusText, NULL, pev );
WRITE_BYTE( 0 );
WRITE_STRING( sbuf0 );
MESSAGE_END();
strcpy( m_SbarString0, sbuf0 );
// make sure everything's resent
bForceResend = TRUE;
}
if( strcmp( sbuf1, m_SbarString1 ) )
{
MESSAGE_BEGIN( MSG_ONE, gmsgStatusText, NULL, pev );
WRITE_BYTE( 1 );
WRITE_STRING( sbuf1 );
MESSAGE_END();
strcpy( m_SbarString1, sbuf1 );
// make sure everything's resent
bForceResend = TRUE;
}
// Check values and send if they don't match
for( int i = 1; i < SBAR_END; i++ )
{
if( newSBarState[i] != m_izSBarState[i] || bForceResend )
{
MESSAGE_BEGIN( MSG_ONE, gmsgStatusValue, NULL, pev );
WRITE_BYTE( i );
WRITE_SHORT( newSBarState[i] );
MESSAGE_END();
m_izSBarState[i] = newSBarState[i];
}
}
}
void CBasePlayer::PowerUpThink( void )
{
int iPowerUp = 0;

1483
dlls/schedule.cpp

File diff suppressed because it is too large Load Diff

6
dlls/triggers.cpp

@ -798,7 +798,7 @@ Used to represent Slime or Lava @@ -798,7 +798,7 @@ Used to represent Slime or Lava
void CTriggerEnvHurt::Spawn( void )
{
InitTrigger();
SetTouch( EnvTouch );
SetTouch( &CBaseTrigger::EnvTouch );
if( FBitSet( pev->spawnflags, SF_TRIGGER_HURT_START_OFF ) )// if flagged to Start Turned Off, make trigger nonsolid.
pev->solid = SOLID_NOT;
@ -2015,9 +2015,9 @@ void CTeleDeath::Spawn( void ) @@ -2015,9 +2015,9 @@ void CTeleDeath::Spawn( void )
UTIL_SetSize( pev, pOwner->pev->mins - Vector( 1, 1, 1 ), pOwner->pev->maxs + Vector( 1, 1, 1 ) );
UTIL_SetOrigin( pev, pev->origin );
SetTouch( DeathTouch );
SetTouch( &CTeleDeath::DeathTouch );
pev->nextthink = gpGlobals->time + 0.2;
SetThink( SUB_Remove );
SetThink( &CBaseEntity::SUB_Remove );
// Touch still players
gpGlobals->force_retouch = 2;

8
dlls/weapons.cpp

@ -765,7 +765,7 @@ int CBasePlayerWeapon::UpdateClientData( CBasePlayer *pPlayer ) @@ -765,7 +765,7 @@ int CBasePlayerWeapon::UpdateClientData( CBasePlayer *pPlayer )
return 1;
}
void CBasePlayerWeapon::SendWeaponAnim( int iAnim, int skiplocal, int body )
void CBasePlayerWeapon::SendWeaponAnim( int iAnim, int skiplocal)
{
if( UseDecrement() )
skiplocal = 1;
@ -887,7 +887,7 @@ BOOL CBasePlayerWeapon::CanDeploy( void ) @@ -887,7 +887,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( char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal /* = 0 */ )
{
if( !CanDeploy() )
return FALSE;
@ -897,7 +897,7 @@ BOOL CBasePlayerWeapon::DefaultDeploy( char *szViewModel, char *szWeaponModel, i @@ -897,7 +897,7 @@ BOOL CBasePlayerWeapon::DefaultDeploy( char *szViewModel, char *szWeaponModel, i
m_pPlayer->pev->viewmodel = MAKE_STRING( szViewModel );
m_pPlayer->pev->weaponmodel = MAKE_STRING( szWeaponModel );
strcpy( m_pPlayer->m_szAnimExtention, szAnimExt );
SendWeaponAnim( iAnim, skiplocal, body );
SendWeaponAnim( iAnim, skiplocal );
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0;
@ -905,7 +905,7 @@ BOOL CBasePlayerWeapon::DefaultDeploy( char *szViewModel, char *szWeaponModel, i @@ -905,7 +905,7 @@ BOOL CBasePlayerWeapon::DefaultDeploy( char *szViewModel, char *szWeaponModel, i
return TRUE;
}
BOOL CBasePlayerWeapon::DefaultReload( int iClipSize, int iAnim, float fDelay, int body )
BOOL CBasePlayerWeapon::DefaultReload( int iClipSize, int iAnim, float fDelay )
{
if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 )
return FALSE;

6
dlls/weapons.h

@ -304,12 +304,12 @@ public: @@ -304,12 +304,12 @@ public:
virtual BOOL PlayEmptySound( void );
virtual void ResetEmptySound( void );
virtual void SendWeaponAnim( int iAnim, int skiplocal = 1, int body = 0 ); // skiplocal is 1 if client is predicting weapon animations
virtual void SendWeaponAnim( int iAnim, int skiplocal = 1 ); // skiplocal is 1 if client is predicting weapon animations
virtual BOOL CanDeploy( void );
virtual BOOL IsUseable( void );
BOOL DefaultDeploy( char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal = 0, int body = 0 );
int DefaultReload( int iClipSize, int iAnim, float fDelay, int body = 0 );
BOOL DefaultDeploy( char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal = 0 );
int DefaultReload( int iClipSize, int iAnim, float fDelay );
virtual void ItemPostFrame( void ); // called each frame by the player PostThink
// called by CBasePlayerWeapons ItemPostFrame()

1
dlls/world.cpp

@ -42,6 +42,7 @@ CGlobalState gGlobalState; @@ -42,6 +42,7 @@ CGlobalState gGlobalState;
extern DLL_GLOBAL int gDisplayTitle;
extern void W_Precache( void );
extern void QuakeClassicPrecache( void );
//
// This must match the list in util.h

Loading…
Cancel
Save