Skip to content

Commit

Permalink
Revert all changes & fixes for clean branch
Browse files Browse the repository at this point in the history
  • Loading branch information
SmileyAG authored Mar 29, 2022
1 parent dab26d6 commit 99af3cb
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 173 deletions.
8 changes: 0 additions & 8 deletions game/client/cdll_client_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include "cbase.h"
#include <crtmemdebug.h>
#include <econ/econ_item_system.h>
#include "vgui_int.h"
#include "clientmode.h"
#include "iinput.h"
Expand Down Expand Up @@ -2529,13 +2528,6 @@ CEG_NOINLINE void CHLClient::LevelInitPreEntity( char const* pMapName )
CEG_PROTECT_MEMBER_FUNCTION( CHLClient_LevelInitPreEntity );

IGameSystem::LevelInitPreEntityAllSystems(pMapName);

GameItemSchema_t *pItemSchema = ItemSystem()->GetItemSchema();
if ( pItemSchema )
{
//pItemSchema->BInit( "scripts/items/items_game.txt", "MOD" );
pItemSchema->BInitFromDelayedBuffer();
}

ResetWindspeed();

Expand Down
4 changes: 2 additions & 2 deletions game/server/ai_task.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: Sets up the tasks for default AI.
//
Expand Down Expand Up @@ -50,7 +50,7 @@ const char *TaskFailureToString( AI_TaskFailureCode_t code )
{
const char *pszResult;
if ( code < 0 || code >= NUM_FAIL_CODES )
pszResult = "Unknown Code!";
pszResult = (const char *)code;
else
pszResult = g_ppszTaskFailureText[code];
return pszResult;
Expand Down
78 changes: 4 additions & 74 deletions game/server/cstrike15/cs_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include "bot.h"
#include "studio.h"
#include <coordsize.h>
#include <econ/econ_entity_creation.h>
#include "predicted_viewmodel.h"
#include "props_shared.h"
#include "tier0/icommandline.h"
Expand Down Expand Up @@ -12381,76 +12380,7 @@ void CCSPlayer::StockPlayerAmmo( CBaseCombatWeapon *pNewWeapon )

void CCSPlayer::FindMatchingWeaponsForTeamLoadout( const char *pchName, int nTeam, bool bMustBeTeamSpecific, CUtlVector< CEconItemView* > &matchingWeapons )
{
//lwss - rebuilt this function from reversing retail bins
const char *weaponName = pchName;
CEconItemDefinition *itemDef = GEconItemSchema().GetItemDefinitionByName( pchName );
if( itemDef )
{
const char *slotName = itemDef->GetRawDefinition()->GetString( "item_slot" );
if( slotName && slotName[0] && !V_stricmp( slotName, "melee" ) )
{
if( nTeam == TEAM_TERRORIST )
{
weaponName = "weapon_knife_t";
}
else
{
weaponName = "weapon_knife";
}
}
}

bool isGunGameDM = true;
if( CSGameRules() && CSGameRules()->IsPlayingGunGame() ){
isGunGameDM = CSGameRules()->IsPlayingGunGameDeathmatch();
}

CEconItemView *baseItemForSlot = NULL;
int slot = LOADOUT_POSITION_MELEE;

while( true )
{
baseItemForSlot = CSInventoryManager()->GetBaseItemForTeam( nTeam, slot );
const GameItemDefinition_t *baseItemDef = baseItemForSlot->GetItemDefinition();
const char *defName = baseItemDef->GetDefinitionName();
if( !V_strcmp(baseItemDef->GetItemBaseName(), weaponName) )
break;

if( ++slot >= 3 )
{
// go through the slots in loadout_positions_t
for( int slotItr = LOADOUT_POSITION_SECONDARY0; slotItr <= LOADOUT_POSITION_HEAVY5; slotItr++ )
{
CEconItemView *slotItrItem = m_Inventory.GetItemInLoadout( nTeam, slotItr );
if( !slotItrItem || !slotItrItem->IsValid() )
continue;
if( V_strcmp( slotItrItem->GetItemDefinition()->GetItemBaseName(), weaponName ) )
continue;

if( !bMustBeTeamSpecific ||
(slotItrItem->GetStaticData()->GetUsedByTeam() == nTeam || slotItrItem->GetStaticData()->GetUsedByTeam() == TEAM_UNASSIGNED ) )
{
Msg("%s is valid weapon for \"%s\" in slot %d\n", defName, weaponName, slotItr );
matchingWeapons.AddToTail( slotItrItem );
}
}
return;
}
}

CEconItemView *slotItem = m_Inventory.GetItemInLoadout( nTeam, slot );
if( slotItem && slotItem->IsValid() && slotItem != baseItemForSlot )
{
if( (isGunGameDM | slot < 2) || !V_strcmp( slotItem->GetItemDefinition()->GetDefinitionName(), weaponName ) )
{
if( !bMustBeTeamSpecific ||
(slotItem->GetStaticData()->GetUsedByTeam() == nTeam || slotItem->GetStaticData()->GetUsedByTeam() == TEAM_UNASSIGNED ) )
{
matchingWeapons.AddToTail( slotItem );
}
}
}
//lwss end
/** Removed for partner depot **/
}

CBaseEntity *CCSPlayer::GiveNamedItem( const char *pchName, int iSubType /*= 0*/, CEconItemView *pScriptItem /*= NULL*/, bool bForce /*= false*/ )
Expand Down Expand Up @@ -12480,7 +12410,7 @@ CBaseEntity *CCSPlayer::GiveNamedItem( const char *pchName, int iSubType /*= 0*/
}
}
}
//#if !defined( NO_STEAM_GAMECOORDINATOR )
#if !defined( NO_STEAM_GAMECOORDINATOR )
if ( pScriptItem && pScriptItem->IsValid() )
{
// Generate a weapon directly from that item
Expand All @@ -12500,7 +12430,7 @@ CBaseEntity *CCSPlayer::GiveNamedItem( const char *pchName, int iSubType /*= 0*/
pItem = ItemGeneration()->GenerateRandomItem( &criteria, GetAbsOrigin(), vec3_angle );
}
}
//#endif
#endif
if ( pItem == NULL )
{
// Trap for guns that 'exist' but never shipped.
Expand All @@ -12523,7 +12453,7 @@ CBaseEntity *CCSPlayer::GiveNamedItem( const char *pchName, int iSubType /*= 0*/
Msg( "NULL Ent in GiveNamedItem!\n" );
return NULL;
}
Msg( "%s is missing an item definition in the schema.\n", pchName );
// Msg( "%s is missing an item definition in the schema.\n", pchName );
}

Vector pos = ( GetLocalOrigin() + Weapon_ShootPosition() ) * 0.5f;
Expand Down
5 changes: 2 additions & 3 deletions game/shared/basecombatweapon_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1757,7 +1757,6 @@ void CBaseCombatWeapon::SetViewModel()
//-----------------------------------------------------------------------------
bool CBaseCombatWeapon::SendWeaponAnim( int iActivity )
{
iActivity = TranslateViewmodelHandActivity( (Activity)iActivity );
//For now, just set the ideal activity and be done with it
return SetIdealActivity( (Activity) iActivity );
}
Expand Down Expand Up @@ -3389,12 +3388,12 @@ END_NETWORK_TABLE()

const CEconItemView* CBaseCombatWeapon::GetEconItemView( void ) const
{
return BaseClass::GetEconItemView();
return nullptr;
}

CEconItemView* CBaseCombatWeapon::GetEconItemView( void )
{
return (CEconItemView*)BaseClass::GetEconItemView();
return nullptr;
}

int CBaseCombatWeapon::GetReserveAmmoCount( AmmoPosition_t nAmmoPosition, CBaseCombatCharacter * pForcedOwner/* = NULL*/ )
Expand Down
8 changes: 2 additions & 6 deletions game/shared/basecombatweapon_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "weapon_parse.h"
#include "baseviewmodel_shared.h"
#include "weapon_proficiency.h"
#include "econ/econ_entity.h"

#if defined( CLIENT_DLL )
#undef CBaseCombatWeapon
Expand Down Expand Up @@ -121,7 +120,7 @@ namespace vgui2
// Purpose: Base weapon class, shared on client and server
//-----------------------------------------------------------------------------

#define BASECOMBATWEAPON_DERIVED_FROM CEconEntity
#define BASECOMBATWEAPON_DERIVED_FROM CBaseAnimating

// temp states for modular weapon body groups
#define MODULAR_BODYGROUPS_DEFAULT_NONE_SET 0
Expand Down Expand Up @@ -526,10 +525,7 @@ class CBaseCombatWeapon : public BASECOMBATWEAPON_DERIVED_FROM
virtual void UpdateVisibility( void );

virtual void BoneMergeFastCullBloat( Vector &localMins, Vector &localMaxs, const Vector &thisEntityMins, const Vector &thisEntityMaxs ) const;
virtual bool OnFireEvent( C_BaseViewModel *pViewModel, const Vector& origin, const QAngle& angles, int event, const char *options )
{
return BaseClass::OnFireEvent( pViewModel, origin, angles, event, options );
}
virtual bool OnFireEvent( C_BaseViewModel *pViewModel, const Vector& origin, const QAngle& angles, int event, const char *options ) { return false; }

// Should this object cast shadows?
virtual ShadowType_t ShadowCastType();
Expand Down
7 changes: 1 addition & 6 deletions game/shared/cstrike15/cs_weapon_parse.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
Expand Down Expand Up @@ -1202,11 +1202,6 @@ GET_WEAPON_ATTR_FUNC( int, GetDefaultSecondaryClipSize, "secondary default clip

GET_WEAPON_ATTR_FUNC( int, GetKillAward, "kill award" )
GET_WEAPON_ATTR_FUNC( bool, HasBurstMode, "has burst mode" )
//lwss - add some more of these that are missing
GET_WEAPON_ATTR_FUNC( float, GetBurstModeTimeBetweenShots, "time between burst shots")
GET_WEAPON_ATTR_FUNC( float, GetBurstModeCycleTime, "cycletime when in burst mode")
GET_WEAPON_ATTR_FUNC( float, GetZoomedCycleTime, "cycletime when zoomed")
//lwss end
GET_WEAPON_ATTR_FUNC( bool, IsRevolver, "is revolver" )
GET_WEAPON_ATTR_FUNC( bool, HasAlternateFastSlowReload, "alternate fastslow reload" )
GET_WEAPON_ATTR_FUNC( float, GetArmorRatio, "armor ratio" )
Expand Down
7 changes: 1 addition & 6 deletions game/shared/cstrike15/cs_weapon_parse.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
Expand Down Expand Up @@ -262,11 +262,6 @@ class CCSWeaponInfo : public FileWeaponInfo_t

int GetKillAward ( const CEconItemView* pWepView = NULL, int nAlt = 0, float flScale = 1.0f ) const;
bool HasBurstMode ( const CEconItemView* pWepView = NULL, int nAlt = 0, float flScale = 1.0f ) const;
//lwss - add some more of these that are missing
float GetBurstModeTimeBetweenShots ( const CEconItemView* pWepView = NULL, int nAlt = 0, float flScale = 1.0f ) const;
float GetBurstModeCycleTime ( const CEconItemView* pWepView = NULL, int nAlt = 0, float flScale = 1.0f ) const;
float GetZoomedCycleTime ( const CEconItemView* pWepView = NULL, int nAlt = 0, float flScale = 1.0f ) const;
//lwss end
bool IsRevolver ( const CEconItemView* pWepView = NULL, int nAlt = 0, float flScale = 1.0f ) const;
bool HasAlternateFastSlowReload ( const CEconItemView* pWepView = NULL, int nAlt = 0, float flScale = 1.0f ) const;
float GetArmorRatio ( const CEconItemView* pWepView = NULL, int nAlt = 0, float flScale = 1.0f ) const;
Expand Down
32 changes: 1 addition & 31 deletions game/shared/cstrike15/weapon_csbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3061,7 +3061,6 @@ void CWeaponCSBase::Spawn()
{
m_nWeaponID = WeaponIdFromString( GetClassname() );

BaseClass::InitializeAttributes();
BaseClass::Spawn();

// Override the bloat that our base class sets as it's a little bit bigger than we want.
Expand Down Expand Up @@ -3833,36 +3832,7 @@ void CWeaponCSBase::OnLand( float fVelocity )

void CWeaponCSBase::Recoil( CSWeaponMode weaponMode )
{
//lwss - rebuilt this function from reversing retail bins
float angle;
float magnitude;
int seed;
CCSPlayer *pPlayer = GetPlayerOwner();
if ( !pPlayer )
return;

//update: Special Thanks to PiMoNFeeD for noticing I missed an if-statement here with the vfunc IsFullAuto().
// The recoil was a bit wonky.
if( !IsFullAuto() )
{
seed = GetPredictionRandomSeed();
}
else
{
seed = (int) m_flRecoilIndex;
}

if( weapon_legacy_recoiltable.GetBool() )
{
GetCSWpnData().GetRecoilOffsets( weaponMode, seed, angle, magnitude );
}
else
{
g_WeaponRecoilData.GetRecoilOffsets( this, weaponMode, seed, angle, magnitude );
}

pPlayer->KickBack( angle, magnitude );
//lwss end
/** Removed for partner depot **/
}

#ifdef CLIENT_DLL
Expand Down
5 changes: 0 additions & 5 deletions game/shared/cstrike15/weapon_csbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,6 @@ class CWeaponCSBase : public CBaseCombatWeapon
virtual void WeaponReset( void ) {}
virtual bool WeaponHasBurst() const { return false; }
virtual bool IsInBurstMode() { return m_bBurstMode; }
//lwss - added some more that were missing
virtual float GetBurstModeTimeBetweenShots() { return 0.0f; }
virtual float GetBurstModeCycleTime() { return 0.0f; }
virtual float GetZoomedCycleTime() { return 0.0f; }
//lwss end
virtual bool IsRevolver() const { return false; }

void ItemPostFrame_ProcessPrimaryAttack( CCSPlayer *pPlayer );
Expand Down
24 changes: 8 additions & 16 deletions game/shared/cstrike15/weapon_csbasegun.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
Expand Down Expand Up @@ -320,17 +320,12 @@ void CWeaponCSBaseGun::PrimaryAttack()
// change a few things if we're in burst mode
if ( IsInBurstMode() )
{
//CALL_ATTRIB_HOOK_FLOAT( flCycleTime, cycletime_when_in_burst_mode );

//lwss - replaced usage of CALL_ATTRIB_HOOK* for GET_WEAPON_ATTR_FUNC() instead.
flCycleTime = GetBurstModeCycleTime();
CALL_ATTRIB_HOOK_FLOAT( flCycleTime, cycletime_when_in_burst_mode );

m_iBurstShotsRemaining = 2;

//m_fNextBurstShot = gpGlobals->curtime;
//CALL_ATTRIB_HOOK_FLOAT( m_fNextBurstShot, time_between_burst_shots );

m_fNextBurstShot = gpGlobals->curtime + GetBurstModeTimeBetweenShots();
m_fNextBurstShot = gpGlobals->curtime;
CALL_ATTRIB_HOOK_FLOAT( m_fNextBurstShot, time_between_burst_shots );
}

if ( IsZoomed() )
Expand Down Expand Up @@ -636,8 +631,7 @@ void CWeaponCSBaseGun::BurstFireRemaining()
return;
}

const CCSWeaponInfo& weaponInfo = GetCSWpnData();
uint16 nItemDefIndex = GetEconItemView()->GetItemIndex();
uint16 nItemDefIndex = 0;

FX_FireBullets(
pPlayer->entindex(),
Expand All @@ -663,16 +657,14 @@ void CWeaponCSBaseGun::BurstFireRemaining()

if ( m_iBurstShotsRemaining > 0 )
{
//CALL_ATTRIB_HOOK_FLOAT( m_fNextBurstShot, time_between_burst_shots );
//lwss - replaced usage of CALL_ATTRIB_HOOK* for GET_WEAPON_ATTR_FUNC() instead.
m_fNextBurstShot = gpGlobals->curtime + weaponInfo.GetBurstModeTimeBetweenShots( GetEconItemView() );
CALL_ATTRIB_HOOK_FLOAT( m_fNextBurstShot, time_between_burst_shots );
}
else
{
m_fNextBurstShot = 0.0f;
}

//const CCSWeaponInfo& weaponInfo = GetCSWpnData();
const CCSWeaponInfo& weaponInfo = GetCSWpnData();

// update accuracy
m_fAccuracyPenalty += weaponInfo.GetInaccuracyFire( GetEconItemView(), m_weaponMode );
Expand Down Expand Up @@ -736,7 +728,7 @@ bool CWeaponCSBaseGun::CSBaseGunFire( float flCycleTime, CSWeaponMode weaponMode
// player "shoot" animation
pPlayer->SetAnimation( PLAYER_ATTACK1 );

uint16 nItemDefIndex = GetEconItemView()->GetItemIndex();
uint16 nItemDefIndex = 0;

FX_FireBullets(
pPlayer->entindex(),
Expand Down
7 changes: 1 addition & 6 deletions game/shared/cstrike15/weapon_csbasegun.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
Expand Down Expand Up @@ -69,11 +69,6 @@ class CWeaponCSBaseGun : public CWeaponCSBase

virtual bool WeaponHasBurst( void ) const { return GetCSWpnData().HasBurstMode( GetEconItemView() ); }
virtual bool IsInBurstMode() const;
//lwss - added some more that were missing
virtual float GetBurstModeTimeBetweenShots() OVERRIDE { return GetCSWpnData().GetBurstModeTimeBetweenShots( GetEconItemView() ); }
virtual float GetBurstModeCycleTime() OVERRIDE { return GetCSWpnData().GetBurstModeCycleTime( GetEconItemView() ); }
virtual float GetZoomedCycleTime() OVERRIDE { return GetCSWpnData().GetZoomedCycleTime( GetEconItemView() ); }
//lwss end

virtual bool IsFullAuto() const;

Expand Down
4 changes: 2 additions & 2 deletions game/shared/cstrike15/weapon_m3.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
Expand Down Expand Up @@ -114,7 +114,7 @@ void CWeaponM3::PrimaryAttack()
// player "shoot" animation
pPlayer->SetAnimation( PLAYER_ATTACK1 );

uint16 nItemDefIndex = GetEconItemView()->GetItemIndex();
uint16 nItemDefIndex = 0;

// Dispatch the FX right away with full accuracy.
float flCurAttack = CalculateNextAttackTime( flCycleTime );
Expand Down
Loading

0 comments on commit 99af3cb

Please sign in to comment.