Browse Source

Fix build.

opforfixed
Night Owl 8 years ago
parent
commit
64b49baad8
  1. 1
      cl_dll/hl/hl_baseentity.cpp
  2. 15
      dlls/gearbox/ctf_gamerules.cpp
  3. 16
      dlls/gearbox/ctf_gamerules.h
  4. 7
      dlls/gearbox/ctf_items.cpp
  5. 7
      dlls/gearbox/ctf_items.h
  6. 17
      dlls/gearbox/ctf_powerups.cpp
  7. 6
      dlls/gearbox/ctf_powerups.h
  8. 6
      dlls/gearbox/gearbox_player.h
  9. 4
      dlls/gearbox/geneworm.cpp
  10. 5
      dlls/gearbox/ropes.cpp
  11. 37
      dlls/weapons.cpp
  12. 5
      dlls/weapons.h

1
cl_dll/hl/hl_baseentity.cpp

@ -314,6 +314,7 @@ int CBasePlayerItem::Restore( class CRestore & ) { return 1; }
int CBasePlayerItem::Save( class CSave & ) { return 1; } int CBasePlayerItem::Save( class CSave & ) { return 1; }
int CBasePlayerWeapon::Restore( class CRestore & ) { return 1; } int CBasePlayerWeapon::Restore( class CRestore & ) { return 1; }
int CBasePlayerWeapon::Save( class CSave & ) { return 1; } int CBasePlayerWeapon::Save( class CSave & ) { return 1; }
float CBasePlayerWeapon::GetNextAttackDelay( float flTime ) { return flTime; }
void CBasePlayerItem::SetObjectCollisionBox( void ) { } void CBasePlayerItem::SetObjectCollisionBox( void ) { }
void CBasePlayerItem::FallInit( void ) { } void CBasePlayerItem::FallInit( void ) { }
void CBasePlayerItem::FallThink( void ) { } void CBasePlayerItem::FallThink( void ) { }

15
dlls/gearbox/ctf_gamerules.cpp

@ -20,8 +20,6 @@ This contains all the gamerules for the Half-Life: Opposing force CTF Gamemode.
*/ */
#ifdef GEARBOX_CTF
#define NUM_TEAMS 2 #define NUM_TEAMS 2
char *sTeamNames[] = char *sTeamNames[] =
@ -76,6 +74,7 @@ edict_t *EntSelectSpawnPoint(CBaseEntity *pPlayer, bool bCheckDM)
#endif #endif
extern edict_t *RuneSelectSpawnPoint(void); extern edict_t *RuneSelectSpawnPoint(void);
#ifndef NO_VOICEGAMEMGR
class CCTFGameMgrHelper : public IVoiceGameMgrHelper class CCTFGameMgrHelper : public IVoiceGameMgrHelper
{ {
public: public:
@ -85,6 +84,7 @@ public:
} }
}; };
static CCTFGameMgrHelper g_GameMgrHelper; static CCTFGameMgrHelper g_GameMgrHelper;
#endif
extern DLL_GLOBAL BOOL g_fGameOver; extern DLL_GLOBAL BOOL g_fGameOver;
@ -98,9 +98,10 @@ char* GetTeamName(int team)
CCTFMultiplay::CCTFMultiplay() CCTFMultiplay::CCTFMultiplay()
{ {
#ifndef NO_VOICEGAMEMGR
// CHalfLifeMultiplay already initialized it - just override its helper callback. // CHalfLifeMultiplay already initialized it - just override its helper callback.
m_VoiceGameMgr.SetHelper(&g_GameMgrHelper); m_VoiceGameMgr.SetHelper(&g_GameMgrHelper);
#endif
m_DisableDeathMessages = FALSE; m_DisableDeathMessages = FALSE;
m_DisableDeathPenalty = FALSE; m_DisableDeathPenalty = FALSE;
@ -149,8 +150,9 @@ extern cvar_t timeleft, fragsleft;
void CCTFMultiplay::Think(void) void CCTFMultiplay::Think(void)
{ {
#ifndef NO_VOICEGAMEMGR
m_VoiceGameMgr.Update(gpGlobals->frametime); m_VoiceGameMgr.Update(gpGlobals->frametime);
#endif
///// Check game rules ///// ///// Check game rules /////
static int last_frags; static int last_frags;
static int last_time; static int last_time;
@ -310,9 +312,10 @@ void DropRune(CBasePlayer *pPlayer);
//========================================================= //=========================================================
BOOL CCTFMultiplay::ClientCommand(CBasePlayer *pPlayer, const char *pcmd) BOOL CCTFMultiplay::ClientCommand(CBasePlayer *pPlayer, const char *pcmd)
{ {
#ifndef NO_VOICEGAMEMGR
if (m_VoiceGameMgr.ClientCommand(pPlayer, pcmd)) if (m_VoiceGameMgr.ClientCommand(pPlayer, pcmd))
return TRUE; return TRUE;
#endif
if (FStrEq(pcmd, "menuselect")) if (FStrEq(pcmd, "menuselect"))
{ {
if (CMD_ARGC() < 2) if (CMD_ARGC() < 2)
@ -1686,5 +1689,3 @@ void CCTFMultiplay::RecountTeams(void)
} }
} }
} }
#endif // GEARBOX_CTF

16
dlls/gearbox/ctf_gamerules.h

@ -3,12 +3,11 @@
#ifndef CTF_GAMERULES_H #ifndef CTF_GAMERULES_H
#define CTF_GAMERULES_H #define CTF_GAMERULES_H
#if defined ( GEARBOX_CTF )
#define BLUE 2 #define BLUE 2
#define RED 1 #define RED 1
#ifndef NO_VOICEGAMEMGR
#include "voice_gamemgr.h" #include "voice_gamemgr.h"
#endif
// Standard Scoring // Standard Scoring
#define TEAM_CAPTURE_CAPTURE_BONUS 5 // what you get for capture #define TEAM_CAPTURE_CAPTURE_BONUS 5 // what you get for capture
@ -75,7 +74,7 @@
#define PLAYER_MAX_HEALTH_VALUE 100 #define PLAYER_MAX_HEALTH_VALUE 100
#define PLAYER_MAX_ARMOR_VALUE 100 #define PLAYER_MAX_ARMOR_VALUE 100
class CCTFMultiplay : public CGearboxMultiplay class CCTFMultiplay : public CHalfLifeMultiplay
{ {
public: public:
CCTFMultiplay(); CCTFMultiplay();
@ -118,9 +117,9 @@ public:
int iRedTeamScore; int iRedTeamScore;
float m_flFlagStatusTime; float m_flFlagStatusTime;
#ifndef NO_VOICEGAMEMGR
CVoiceGameMgr m_VoiceGameMgr; CVoiceGameMgr m_VoiceGameMgr;
#endif
private: private:
void RecountTeams(void); void RecountTeams(void);
@ -129,7 +128,4 @@ private:
BOOL m_teamLimit; // This means the server set only some teams as valid BOOL m_teamLimit; // This means the server set only some teams as valid
char m_szTeamList[TEAMPLAY_TEAMLISTLENGTH]; char m_szTeamList[TEAMPLAY_TEAMLISTLENGTH];
}; };
#endif // CTF_GAMERULES_H
#endif // GEARBOX_CTF
#endif // CTF_GAMERULES_H

7
dlls/gearbox/ctf_items.cpp

@ -20,10 +20,6 @@ This contains the Flag entity information for the Half-Life : Opposing force CTF
*/ */
#if defined ( GEARBOX_CTF )
#include "extdll.h" #include "extdll.h"
#include "util.h" #include "util.h"
#include "cbase.h" #include "cbase.h"
@ -723,6 +719,3 @@ void CCarriedFlagTeam2::Spawn(void)
LINK_ENTITY_TO_CLASS(carried_flag_team1, CCarriedFlagTeam1); LINK_ENTITY_TO_CLASS(carried_flag_team1, CCarriedFlagTeam1);
LINK_ENTITY_TO_CLASS(carried_flag_team2, CCarriedFlagTeam2); LINK_ENTITY_TO_CLASS(carried_flag_team2, CCarriedFlagTeam2);
#endif // GEARBOX_CTF

7
dlls/gearbox/ctf_items.h

@ -12,9 +12,6 @@
* without written permission from Valve LLC. * without written permission from Valve LLC.
* *
****/ ****/
#if defined ( GEARBOX_CTF )
#ifndef CTF_ITEMS_H #ifndef CTF_ITEMS_H
#define CTF_ITEMS_H #define CTF_ITEMS_H
@ -124,8 +121,4 @@ class CCarriedFlagTeam2 : public CCarriedFlag
{ {
void Spawn(void); void Spawn(void);
}; };
#endif // CTF_ITEMS_H #endif // CTF_ITEMS_H
#endif // GEARBOX_CTF

17
dlls/gearbox/ctf_powerups.cpp

@ -19,11 +19,6 @@
This contains the Flag entity information for the Half-Life : Opposing force CTF Gamemode. This contains the Flag entity information for the Half-Life : Opposing force CTF Gamemode.
*/ */
#ifdef GEARBOX_CTF
#include "extdll.h" #include "extdll.h"
#include "util.h" #include "util.h"
#include "cbase.h" #include "cbase.h"
@ -231,18 +226,18 @@ void CPowerupCTFBase::RuneTouch(CBaseEntity *pOther)
if (pOther->pev->team != m_teamNo - 1) if (pOther->pev->team != m_teamNo - 1)
return; return;
} }
/*
//Only one per customer //Only one per customer
if (pPlayer->m_iRuneStatus) if (pPlayer->m_iRuneStatus)
{ {
ClientPrint(pOther->pev, HUD_PRINTCENTER, "You already have a rune!\n"); ClientPrint(pOther->pev, HUD_PRINTCENTER, "You already have a rune!\n");
return; return;
} }
*/
if (!m_bTouchable) if (!m_bTouchable)
return; return;
pPlayer->m_iRuneStatus = m_iRuneFlag; //Add me the rune flag //pPlayer->m_iRuneStatus = m_iRuneFlag; //Add me the rune flag
ClientPrint(pOther->pev, HUD_PRINTCENTER, "You got the rune of %s!\n", STRING(m_iszPrintName)); ClientPrint(pOther->pev, HUD_PRINTCENTER, "You got the rune of %s!\n", STRING(m_iszPrintName));
@ -260,10 +255,10 @@ void CPowerupCTFBase::RuneTouch(CBaseEntity *pOther)
EMIT_SOUND(ENT(pev), CHAN_ITEM, "weapons/ammopickup2.wav", 1, ATTN_NORM); EMIT_SOUND(ENT(pev), CHAN_ITEM, "weapons/ammopickup2.wav", 1, ATTN_NORM);
//Update my client side rune hud thingy. //Update my client side rune hud thingy.
MESSAGE_BEGIN(MSG_ONE, gmsgRuneStatus, NULL, pOther->pev); /* MESSAGE_BEGIN(MSG_ONE, gmsgRuneStatus, NULL, pOther->pev);
WRITE_BYTE(pPlayer->m_iRuneStatus); WRITE_BYTE(pPlayer->m_iRuneStatus);
MESSAGE_END(); MESSAGE_END();
*/
//And Remove this entity //And Remove this entity
UTIL_Remove(this); UTIL_Remove(this);
} }
@ -478,5 +473,3 @@ void SpawnRunes(void)
g_bSpawnedRunes = TRUE; g_bSpawnedRunes = TRUE;
} }
#endif // GEARBOX_CTF

6
dlls/gearbox/ctf_powerups.h

@ -12,9 +12,6 @@
* without written permission from Valve LLC. * without written permission from Valve LLC.
* *
****/ ****/
#if defined ( GEARBOX_CTF )
#ifndef CTF_POWERUPS_H #ifndef CTF_POWERUPS_H
#define CTF_POWERUPS_H #define CTF_POWERUPS_H
@ -121,7 +118,4 @@ public:
m_iszPrintName = MAKE_STRING("Portable HEV"); m_iszPrintName = MAKE_STRING("Portable HEV");
} }
}; };
#endif // CTF_POWERUPS_H #endif // CTF_POWERUPS_H
#endif // GEARBOX_CTF

6
dlls/gearbox/gearbox_player.h

@ -15,12 +15,10 @@
#ifndef GEARBOX_PLAYER_H #ifndef GEARBOX_PLAYER_H
#define GEARBOX_PLAYER_H #define GEARBOX_PLAYER_H
#ifdef GEARBOX_CTF
enum Player_Menu { enum Player_Menu {
Team_Menu, Team_Menu,
Team_Menu_IG, Team_Menu_IG,
}; };
#endif
#define PFLAG_ONROPE ( 1 << 6 ) #define PFLAG_ONROPE ( 1 << 6 )
@ -42,7 +40,6 @@ private:
BOOL m_fInXen; BOOL m_fInXen;
BOOL m_fIsFrozen; BOOL m_fIsFrozen;
#if defined ( GEARBOX_CTF )
public: public:
int m_bHasFlag; int m_bHasFlag;
void ShowMenu(int bitsValidSlots, int nDisplayTime, BOOL fNeedMore, char *pszText); void ShowMenu(int bitsValidSlots, int nDisplayTime, BOOL fNeedMore, char *pszText);
@ -73,11 +70,10 @@ public:
void Service_Grapple(void); void Service_Grapple(void);
private: private:
#endif
friend class CDisplacer; friend class CDisplacer;
friend class CTriggerXenReturn; friend class CTriggerXenReturn;
friend class CPlayerFreeze; friend class CPlayerFreeze;
}; };
#endif // GEARBOX_PLAYER_H #endif // GEARBOX_PLAYER_H

4
dlls/gearbox/geneworm.cpp

@ -216,7 +216,7 @@ const char *CGeneWorm::pEyePainSounds[] =
"geneworm/geneworm_shot_in_eye.wav", "geneworm/geneworm_shot_in_eye.wav",
}; };
const char* CGeneWorm::pHitVolumes[] const char* CGeneWorm::pHitVolumes[] =
{ {
"GeneWormRightSlash", "GeneWormRightSlash",
"GeneWormCenterSlash", "GeneWormCenterSlash",
@ -629,4 +629,4 @@ float CGeneWorm::MyEnemyHeight(void)
} }
return GENEWORM_LEVEL1_HEIGHT; return GENEWORM_LEVEL1_HEIGHT;
} }

5
dlls/gearbox/ropes.cpp

@ -244,7 +244,8 @@ void CRope::RopeThink(void)
ApplyFunctor(Functor_SetSegmentFxNormal); ApplyFunctor(Functor_SetSegmentFxNormal);
int index = FindClosestSegment(((CBasePlayer*)pEntity)->GetGunPosition(), 16, 0, m_nSegments - 1); Vector v = ((CBasePlayer*)pEntity)->GetGunPosition();
int index = FindClosestSegment(v, 16, 0, m_nSegments - 1);
if (index >= 0 && index < m_nSegments) if (index >= 0 && index < m_nSegments)
{ {
CRopeSegment* pClosestSegment = m_pSegments[index]; CRopeSegment* pClosestSegment = m_pSegments[index];
@ -341,4 +342,4 @@ void CRope::ApplyFunctor(void(*functor)(CRopeSegment* pSegment), int startIndex,
void CRope::ApplyFunctor(void(*functor)(CRopeSegment* pSegment)) void CRope::ApplyFunctor(void(*functor)(CRopeSegment* pSegment))
{ {
ApplyFunctor(functor, 0, -1); ApplyFunctor(functor, 0, -1);
} }

37
dlls/weapons.cpp

@ -655,6 +655,11 @@ void CBasePlayerWeapon::ItemPostFrame( void )
m_fInReload = FALSE; m_fInReload = FALSE;
} }
if( !( m_pPlayer->pev->button & IN_ATTACK ) )
{
m_flLastFireTime = 0.0f;
}
if( ( m_pPlayer->pev->button & IN_ATTACK2 ) && CanAttack( m_flNextSecondaryAttack, gpGlobals->time, UseDecrement() ) ) if( ( m_pPlayer->pev->button & IN_ATTACK2 ) && CanAttack( m_flNextSecondaryAttack, gpGlobals->time, UseDecrement() ) )
{ {
if( pszAmmo2() && !m_pPlayer->m_rgAmmo[SecondaryAmmoIndex()] ) if( pszAmmo2() && !m_pPlayer->m_rgAmmo[SecondaryAmmoIndex()] )
@ -986,6 +991,7 @@ BOOL CBasePlayerWeapon::DefaultDeploy( char *szViewModel, char *szWeaponModel, i
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0;
m_flLastFireTime = 0.0f;
return TRUE; return TRUE;
} }
@ -1173,6 +1179,37 @@ void CBasePlayerWeapon::RetireWeapon( void )
g_pGameRules->GetNextBestWeapon( m_pPlayer, this ); g_pGameRules->GetNextBestWeapon( m_pPlayer, this );
} }
//=========================================================================
// GetNextAttackDelay - An accurate way of calcualting the next attack time.
//=========================================================================
float CBasePlayerWeapon::GetNextAttackDelay( float delay )
{
if( m_flLastFireTime == 0 || m_flNextPrimaryAttack == -1 )
{
// At this point, we are assuming that the client has stopped firing
// and we are going to reset our book keeping variables.
m_flLastFireTime = gpGlobals->time;
m_flPrevPrimaryAttack = delay;
}
// calculate the time between this shot and the previous
float flTimeBetweenFires = gpGlobals->time - m_flLastFireTime;
float flCreep = 0.0f;
if( flTimeBetweenFires > 0 )
flCreep = flTimeBetweenFires - m_flPrevPrimaryAttack; // postive or negative
// save the last fire time
m_flLastFireTime = gpGlobals->time;
float flNextAttack = UTIL_WeaponTimeBase() + delay - flCreep;
// we need to remember what the m_flNextPrimaryAttack time is set to for each shot,
// store it as m_flPrevPrimaryAttack.
m_flPrevPrimaryAttack = flNextAttack - UTIL_WeaponTimeBase();
//char szMsg[256];
//_snprintf( szMsg, sizeof(szMsg), "next attack time: %0.4f\n", gpGlobals->time + flNextAttack );
//OutputDebugString( szMsg );
return flNextAttack;
}
//********************************************************* //*********************************************************
// weaponbox code: // weaponbox code:
//********************************************************* //*********************************************************

5
dlls/weapons.h

@ -376,6 +376,7 @@ public:
void PrintState( void ); void PrintState( void );
virtual CBasePlayerItem *GetWeaponPtr( void ) { return (CBasePlayerItem *)this; }; virtual CBasePlayerItem *GetWeaponPtr( void ) { return (CBasePlayerItem *)this; };
float GetNextAttackDelay( float delay );
float m_flPumpTime; float m_flPumpTime;
int m_fInSpecialReload; // Are we in the middle of a reload for the shotguns int m_fInSpecialReload; // Are we in the middle of a reload for the shotguns
@ -390,6 +391,10 @@ public:
int m_fInReload; // Are we in the middle of a reload; int m_fInReload; // Are we in the middle of a reload;
int m_iDefaultAmmo;// how much ammo you get when you pick up this weapon as placed by a level designer. int m_iDefaultAmmo;// how much ammo you get when you pick up this weapon as placed by a level designer.
// hle time creep vars
float m_flPrevPrimaryAttack;
float m_flLastFireTime;
}; };
class CBasePlayerAmmo : public CBaseEntity class CBasePlayerAmmo : public CBaseEntity

Loading…
Cancel
Save