Skip to content

Commit 068f635

Browse files
mastercomsReplayCoding
authored andcommitted
fix missing schema workarounds and use VALVE_PURE better
1 parent 6ff48ac commit 068f635

File tree

5 files changed

+32
-6
lines changed

5 files changed

+32
-6
lines changed

src/game/client/tf/vgui/quest_item_panel.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,10 @@ void CQuestItemPanel::OnThink()
12701270
//-----------------------------------------------------------------------------
12711271
void CQuestItemPanel::FireGameEvent( IGameEvent *event )
12721272
{
1273+
#ifndef VALVE_PURE
1274+
// FIXME(mastercoms): disable quests
1275+
return;
1276+
#endif
12731277
tmZone( TELEMETRY_LEVEL0, TMZF_NONE, "%s", __FUNCTION__ );
12741278
if( FStrEq( event->GetName(), "quest_objective_completed" ) )
12751279
{

src/game/client/tf/vgui/quest_log_panel.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,10 @@ void CQuestLogPanel::OnCommand( const char *pCommand )
809809
//-----------------------------------------------------------------------------
810810
void CQuestLogPanel::FireGameEvent( IGameEvent *event )
811811
{
812+
#ifndef VALVE_PURE
813+
// FIXME(mastercoms): disable quests
814+
return;
815+
#endif
812816
tmZone( TELEMETRY_LEVEL0, TMZF_NONE, "%s", __FUNCTION__ );
813817
// Listen for inventory updates in case our item gets changed while the user
814818
// is looking at us. We want to re-do our entire layout since a quest might

src/game/shared/schemainitutils.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
// used for initialization functions. Adds an error message if we're recording
1515
// them or returns false if we're not
16-
#ifdef DEBUG
16+
#if defined(DEBUG) || defined(VALVE_PURE)
1717
#define SCHEMA_INIT_CHECK( expr, ... ) \
1818
if ( false == ( expr ) ) \
1919
{ \
@@ -25,12 +25,14 @@
2525
} \
2626
else \
2727
{ \
28+
#ifndef VALVE_PURE \
2829
Warning( "%s\n", msg.String() ); \
2930
/*
3031
todo(maximsmol):
3132
we do not support upstream item schema
3233
*/ \
3334
return false; \
35+
#endif \
3436
pVecErrors->AddToTail( msg ); \
3537
} \
3638
return false; \

src/game/shared/tf/tf_item_schema.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2587,9 +2587,12 @@ bool CTFItemSchema::BInitQuestObjectiveConditions( KeyValues *pKVConditionsBlock
25872587
FOR_EACH_TRUE_SUBKEY( pKVConditionsBlock, pKVCondition )
25882588
{
25892589
CTFQuestObjectiveConditionsDefinition *pNewCondition = new CTFQuestObjectiveConditionsDefinition();
2590-
//SCHEMA_INIT_SUBSTEP( pNewCondition->BInitFromKV( pKVCondition, pVecErrors ) );
25912590

2591+
#ifdef VALVE_PURE
2592+
SCHEMA_INIT_SUBSTEP( pNewCondition->BInitFromKV( pKVCondition, pVecErrors ) );
2593+
#else
25922594
if (pNewCondition->BInitFromKV(pKVCondition, pVecErrors))
2595+
#endif
25932596
{
25942597
m_mapQuestObjectiveConditions.Insert( pNewCondition->GetDefIndex(), pNewCondition );
25952598
}

src/game/shared/tf/tf_quest_restriction.cpp

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,9 @@ class CTFQuestOperatorRestriction: public CTFQuestRestriction
474474
CTFQuestRestriction *pNewRestriction = CreateRestrictionByName( pszType, this );
475475
SCHEMA_INIT_CHECK( pNewRestriction != NULL, "%s", CFmtStr( "Failed to create quest restriction name '%s' for '%s'", pszType, GetConditionName() ).Get() );
476476

477+
#ifndef VALVE_PURE
477478
if (pNewRestriction != NULL)
479+
#endif
478480
{
479481
SCHEMA_INIT_CHECK( pNewRestriction->BInitFromKV( pSubKey, pVecErrors ), "Failed to init from KeyValues" );
480482

@@ -2308,12 +2310,17 @@ class CTFQuestEventListener : public CTFQuestEvaluator, public CGameEventListene
23082310

23092311
FOR_EACH_TRUE_SUBKEY( pKVItem, pSubKey )
23102312
{
2311-
//SCHEMA_INIT_CHECK( !m_pRestrictions, "%s", CFmtStr( "Too many input for operator '%s'.", GetConditionName() ).Get() );
2313+
#ifdef VALVE_PURE
2314+
SCHEMA_INIT_CHECK( !m_pRestrictions, "%s", CFmtStr( "Too many input for operator '%s'.", GetConditionName() ).Get() );
2315+
#endif
23122316

23132317
const char *pszType = pSubKey->GetString( "type" );
23142318
m_pRestrictions = CreateRestrictionByName( pszType, this );
2315-
//SCHEMA_INIT_CHECK( m_pRestrictions != NULL, "%s", CFmtStr( "Failed to create quest restriction name '%s' for '%s'", pszType, GetConditionName() ).Get() );
2319+
#ifdef VALVE_PURE
2320+
SCHEMA_INIT_CHECK( m_pRestrictions != NULL, "%s", CFmtStr( "Failed to create quest restriction name '%s' for '%s'", pszType, GetConditionName() ).Get() );
2321+
#else
23162322
if (m_pRestrictions != NULL)
2323+
#endif
23172324
{
23182325
SCHEMA_INIT_CHECK( m_pRestrictions->BInitFromKV( pSubKey, pVecErrors ), "Failed to init from KeyValues" );
23192326
}
@@ -2355,6 +2362,10 @@ class CTFQuestEventListener : public CTFQuestEvaluator, public CGameEventListene
23552362

23562363
virtual void FireGameEvent( IGameEvent *pEvent ) OVERRIDE
23572364
{
2365+
#ifndef VALVE_PURE
2366+
// FIXME(mastercoms): disable quest restrictions
2367+
return;
2368+
#endif
23582369
// This can happen when the player's SteamID isn't setup yet after a
23592370
// disconnect -> reconnect
23602371
if ( GetQuestOwner() == NULL )
@@ -2521,9 +2532,11 @@ class CTFQuestCountEvaluator : public CTFQuestEvaluator
25212532
{
25222533
const char *pszType = pSubKey->GetString( "type" );
25232534
CTFQuestEvaluator *pNewCond = assert_cast< CTFQuestEvaluator* >( CreateEvaluatorByName( pszType, this ) );
2524-
//SCHEMA_INIT_CHECK( pNewCond && pNewCond->BInitFromKV( pSubKey, pVecErrors ), "Failed to init from KeyValues" );
2525-
2535+
#ifdef VALVE_PURE
2536+
SCHEMA_INIT_CHECK( pNewCond && pNewCond->BInitFromKV( pSubKey, pVecErrors ), "Failed to init from KeyValues" );
2537+
#else
25262538
if (pNewCond && pNewCond->BInitFromKV(pSubKey, pVecErrors))
2539+
#endif
25272540
{
25282541
const char *pszAction = pSubKey->GetString( "action", NULL );
25292542
SCHEMA_INIT_CHECK( pszAction != NULL, "Missing action key" );

0 commit comments

Comments
 (0)