summaryrefslogtreecommitdiff
path: root/game/shared/tf/quest_objective_trackers.cpp
blob: 3f21d4ed43c261915532a013c442e64a87e16866 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//

#include "cbase.h"
#include "quest_objective_manager.h"
#include "gcsdk/gcclient.h"
#include "gc_clientsystem.h"
#include "econ_quests.h"
#include "tf_gamerules.h"
#include "schemainitutils.h"
#include "econ_item_system.h"
#ifdef CLIENT_DLL
	#include "quest_log_panel.h"
#endif

// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"

#if defined( DEBUG ) || defined( STAGING_ONLY )
ConVar tf_quests_commit_every_point( "tf_quests_commit_every_point", "0", FCVAR_REPLICATED );
ConVar tf_quests_progress_enabled( "tf_quests_progress_enabled", "1", FCVAR_REPLICATED );
#endif


CQuestObjectiveManager *QuestObjectiveManager( void )
{
	static CQuestObjectiveManager g_QuestObjectiveManager;
	return &g_QuestObjectiveManager;
}

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
CBaseQuestObjectiveTracker::CBaseQuestObjectiveTracker( const CTFQuestObjectiveDefinition* pObjective, CQuestItemTracker* pParent )
	: m_nObjectiveDefIndex( pObjective->GetDefinitionIndex() )
	, m_pParent( pParent )
	, m_pEvaluator( NULL )
{
	KeyValues *pKVConditions = pObjective->GetConditionsKeyValues();
	
	AssertMsg( !m_pEvaluator, "%s", CFmtStr( "Too many input for operator '%s'.", GetConditionName() ).Get() );

	const char *pszType = pKVConditions->GetString( "type" );
	m_pEvaluator = CreateEvaluatorByName( pszType, this );
	AssertMsg( m_pEvaluator != NULL, "%s", CFmtStr( "Failed to create quest condition name '%s' for '%s'", pszType, GetConditionName() ).Get() );

	SO_TRACKER_SPEW( CFmtStr( "Creating objective tracker def %d for quest def %d on item %llu for user %s\n",
							  pObjective->GetDefinitionIndex(),
							  pParent->GetItem()->GetItemDefinition()->GetDefinitionIndex(),
							  pParent->GetItem()->GetID(),
							  pParent->GetOwnerSteamID().Render() ),
					 SO_TRACKER_SPEW_OBJECTIVE_TRACKER_MANAGEMENT );

	if ( !m_pEvaluator->BInitFromKV( pKVConditions, NULL ) )
	{
		AssertMsg( false, "Failed to init from KeyValues" );
	}
}

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
CBaseQuestObjectiveTracker::~CBaseQuestObjectiveTracker()
{
	if ( m_pEvaluator )
	{
		delete m_pEvaluator;
	}
}

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
bool CBaseQuestObjectiveTracker::IsValidForPlayer( const CTFPlayer *pOwner, InvalidReasonsContainer_t& invalidReasons ) const
{
	return m_pEvaluator->IsValidForPlayer( pOwner, invalidReasons );
}

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
const CTFPlayer *CBaseQuestObjectiveTracker::GetQuestOwner() const
{
	return GetTrackedPlayer();
}

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CBaseQuestObjectiveTracker::EvaluateCondition( CTFQuestEvaluator *pSender, int nScore )
{
#ifdef GAME_DLL
	// tracker should be the root
	Assert( !GetParent() );
	IncrementCount( nScore );
	ResetCondition();
#endif
}

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CBaseQuestObjectiveTracker::ResetCondition()
{
	m_pEvaluator->ResetCondition();
}

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
bool CBaseQuestObjectiveTracker::UpdateConditions()
{
	const CTFQuestObjectiveDefinition *pObjective = (CTFQuestObjectiveDefinition*)ItemSystem()->GetItemSchema()->GetQuestObjectiveByDefIndex( m_nObjectiveDefIndex );
	if ( !pObjective )
		return false;

	// clean up previous evaluator
	if ( m_pEvaluator )
	{
		delete m_pEvaluator;
		m_pEvaluator = NULL;
	}

	CUtlVector< CUtlString > vecErrors;
	return BInitFromKV( pObjective->GetConditionsKeyValues(), &vecErrors );
}

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
const CTFPlayer* CBaseQuestObjectiveTracker::GetTrackedPlayer() const
{
#ifdef CLIENT_DLL
	return ToTFPlayer( C_BasePlayer::GetLocalPlayer() );
#else
	return m_pParent->GetTrackedPlayer();
#endif
}


//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CBaseQuestObjectiveTracker::IncrementCount( int nIncrementValue )
{
	const CTFQuestObjectiveDefinition *pObjective = (CTFQuestObjectiveDefinition*)ItemSystem()->GetItemSchema()->GetQuestObjectiveByDefIndex( m_nObjectiveDefIndex );
	Assert( pObjective );
	if ( !pObjective )
		return;

	uint32 nPointsToAdd = nIncrementValue * pObjective->GetPoints();
	m_pParent->IncrementCount( nPointsToAdd, pObjective );
}

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
CQuestItemTracker::CQuestItemTracker( const CSharedObject* pItem, CSteamID SteamIDOwner, CSOTrackerManager* pManager )
	: CBaseSOTracker( pItem, SteamIDOwner, pManager )
	, m_pItem( NULL )
	, m_nStandardPoints( 0 )
	, m_nBonusPoints( 0 )
#ifdef GAME_DLL
	, m_nStartingStandardPoints( 0 )
	, m_nStartingBonusPoints( 0 )
#endif
{
	m_pItem = assert_cast< const CEconItem* >( pItem );
	// Retrieve starting numbers
	UpdatePointsFromSOItem();

	SO_TRACKER_SPEW( CFmtStr( "Creating tracker for quest %d on item %llu for user %s with %dsp and %dbp\n",
							  GetItem()->GetItemDefinition()->GetDefinitionIndex(),
							  GetItem()->GetID(),
							  GetOwnerSteamID().Render(),
							  GetEarnedStandardPoints(),
							  GetEarnedBonusPoints() ),
					 SO_TRACKER_SPEW_ITEM_TRACKER_MANAGEMENT );

	// Create trackers for each objective
	QuestObjectiveDefVec_t vecChosenObjectives;
	m_pItem->GetItemDefinition()->GetQuestDef()->GetRolledObjectivesForItem( vecChosenObjectives, m_pItem );
	FOR_EACH_VEC( vecChosenObjectives, i )
	{
		if ( !DoesObjectiveNeedToBeTracked( vecChosenObjectives[i] ) )
			continue;

		CBaseQuestObjectiveTracker* pNewTracker = new CBaseQuestObjectiveTracker( vecChosenObjectives[i], this );
		m_vecObjectiveTrackers.AddToTail( pNewTracker );
	}

	if ( m_vecObjectiveTrackers.IsEmpty() )
	{
		SO_TRACKER_SPEW( CFmtStr( "Did not create any objective trackers for quest %d on item %llu for user %s with %dsp and %dbp\n",
								  GetItem()->GetItemDefinition()->GetDefinitionIndex(),
								  GetItem()->GetID(),
								  GetOwnerSteamID().Render(),
								  GetEarnedStandardPoints(),
								  GetEarnedBonusPoints() ),
						 SO_TRACKER_SPEW_OBJECTIVE_TRACKER_MANAGEMENT );
	}
}

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
CQuestItemTracker::~CQuestItemTracker()
{
#ifdef CLIENT_DLL
	SO_TRACKER_SPEW( CFmtStr( "Deleting tracker for quest %u on item %llu with %usp and %ubp\n",
							   m_pItem->GetItemDefinition()->GetDefinitionIndex(),
							   m_pItem->GetItemID(),
							   m_nStandardPoints,
							   m_nBonusPoints ),
					 SO_TRACKER_SPEW_ITEM_TRACKER_MANAGEMENT );
#else
	SO_TRACKER_SPEW( CFmtStr( "Deleting tracker for quest %u on item %llu with %usp %ussp %ubp %usbp\n",
							   m_pItem->GetItemDefinition()->GetDefinitionIndex(),
							   m_pItem->GetItemID(),
							   m_nStandardPoints,
							   m_nStartingStandardPoints,
							   m_nBonusPoints,
							   m_nStartingBonusPoints ),
					 SO_TRACKER_SPEW_ITEM_TRACKER_MANAGEMENT );
#endif
	m_vecObjectiveTrackers.PurgeAndDeleteElements();
}

//-----------------------------------------------------------------------------
// Purpose: Take a look at our item and update what we think our points are
//			based on the attributes on the item IF they are greater.  We NEVER
//			want to lose progress for any reason.
//-----------------------------------------------------------------------------
void CQuestItemTracker::UpdatePointsFromSOItem()
{
	uint32 nNewPoints = 0;
	static CSchemaAttributeDefHandle pAttribDef_EarnedStandardPoints( "quest earned standard points" );
	m_pItem->FindAttribute( pAttribDef_EarnedStandardPoints, &nNewPoints );
#ifdef GAME_DLL
	m_nStartingStandardPoints = Max( nNewPoints, m_nStartingStandardPoints );
#else
	m_nStandardPoints = Max( nNewPoints, m_nStandardPoints );
#endif

	nNewPoints = 0;
	static CSchemaAttributeDefHandle pAttribDef_EarnedBonusPoints( "quest earned bonus points" );
	m_pItem->FindAttribute( pAttribDef_EarnedBonusPoints, &nNewPoints );
#ifdef GAME_DLL
	m_nStartingBonusPoints = Max( nNewPoints, m_nStartingBonusPoints );
#else
	m_nBonusPoints = Max( nNewPoints, m_nBonusPoints );
#endif

#ifdef GAME_DLL
	SendUpdateToClient( NULL );

	SO_TRACKER_SPEW( CFmtStr( "Updated points from item.  CS:%d S:%d  CB:%d B:%d\n", m_nStandardPoints, m_nStartingStandardPoints, m_nBonusPoints, m_nStartingBonusPoints ), SO_TRACKER_SPEW_OBJECTIVES );
#else
	SO_TRACKER_SPEW( CFmtStr( "Updated points from item.  S:%d B:%d\n", m_nStandardPoints, m_nBonusPoints ), SO_TRACKER_SPEW_OBJECTIVES );
#endif
}

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
const CBaseQuestObjectiveTracker* CQuestItemTracker::FindTrackerForDefIndex( uint32 nDefIndex ) const
{
	FOR_EACH_VEC( m_vecObjectiveTrackers, i )
	{
		if ( m_vecObjectiveTrackers[ i ]->GetObjectiveDefIndex() == nDefIndex )
		{
			return m_vecObjectiveTrackers[ i ];
		}
	}

	return NULL;
}

uint32 CQuestItemTracker::GetEarnedStandardPoints() const
{
#ifdef GAME_DLL
	return m_nStartingStandardPoints + m_nStandardPoints;
#else
	return m_nStandardPoints;
#endif
}
uint32 CQuestItemTracker::GetEarnedBonusPoints() const 
{ 
#ifdef GAME_DLL
	return m_nStartingBonusPoints + m_nBonusPoints;
#else
	return m_nBonusPoints;
#endif
}

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CQuestItemTracker::IncrementCount( uint32 nIncrementValue, const CQuestObjectiveDefinition* pObjective )
{
#if defined( DEBUG ) || defined( STAGING_ONLY )
	if ( !tf_quests_progress_enabled.GetBool() )
		return;
#endif

#ifdef GAME_DLL
	Assert( pObjective );
	Assert( m_pItem );
	if ( !pObjective || !m_pItem )
		return;

	auto pQuestDef = m_pItem->GetItemDefinition()->GetQuestDef();
	Assert( pQuestDef );
	if ( !pQuestDef )
		return;

	if ( g_pVGuiLocalize && ( g_nQuestSpewFlags & SO_TRACKER_SPEW_OBJECTIVES ) )
	{
		locchar_t loc_IntermediateName[ MAX_ITEM_NAME_LENGTH ];
		locchar_t locValue[ MAX_ITEM_NAME_LENGTH ];
		loc_sprintf_safe( locValue, LOCCHAR( "%d" ), pObjective->GetPoints() );
		loc_scpy_safe( loc_IntermediateName, CConstructLocalizedString( g_pVGuiLocalize->Find( pObjective->GetDescriptionToken() ), locValue ) );
		char szTempObjectiveName[256];
		::ILocalize::ConvertUnicodeToANSI( loc_IntermediateName, szTempObjectiveName, sizeof( szTempObjectiveName ));

		SO_TRACKER_SPEW( CFmtStr( "Increment for quest: %llu Objective: \"%s\" %d->%d (+%d)\n"
			, m_pItem->GetItemID()
			, szTempObjectiveName
			, m_nStandardPoints + m_nBonusPoints
			, m_nStandardPoints + m_nBonusPoints + nIncrementValue
			, nIncrementValue ), SO_TRACKER_SPEW_OBJECTIVES );
	}

	// Regardless of standard or bonus, we fill the standard gauge first
	uint32 nMaxStandardPoints = pQuestDef->GetMaxStandardPoints() - GetEarnedStandardPoints();
	int nAmountToAdd = Min( nMaxStandardPoints, nIncrementValue );
	m_nStandardPoints += nAmountToAdd;
	nIncrementValue -= nAmountToAdd;

	// If any bonus points left, fill in bonus points
	if ( pObjective->IsAdvanced() && nIncrementValue > 0 )
	{
		uint32 nMaxBonusPoints = pQuestDef->GetMaxBonusPoints() + pQuestDef->GetMaxStandardPoints() - GetEarnedStandardPoints() - GetEarnedBonusPoints();
		m_nBonusPoints += Min( nMaxBonusPoints, nIncrementValue );
	}

	bool bShouldCommit = IsQuestItemReadyToTurnIn( m_pItem );
#if defined( DEBUG ) || defined( STAGING_ONLY )
	bShouldCommit |= tf_quests_commit_every_point.GetBool();
#endif

	// Once we're over the turn-in threshhold, we need to record every point made.
	if ( bShouldCommit )
	{
		CommitChangesToDB();
	}

	SendUpdateToClient( pObjective );
#endif
}

//-----------------------------------------------------------------------------
// Purpose: Remove and delete any objective trackers that are no longer needed.
//			One is considered not needed if it's a tracker for a "standard"
//			objective and we're done getting standard points, or if we're at
//			full bonus points, then there's no way for us to get points anymore
//-----------------------------------------------------------------------------
void CQuestItemTracker::OnUpdate()
{
	FOR_EACH_VEC_BACK( m_vecObjectiveTrackers, i )
	{
		const CQuestObjectiveDefinition *pObjective = GEconItemSchema().GetQuestObjectiveByDefIndex( m_vecObjectiveTrackers[ i ]->GetObjectiveDefIndex() );
		Assert( pObjective );
		if ( !pObjective || !DoesObjectiveNeedToBeTracked( pObjective ) )
		{
			delete m_vecObjectiveTrackers[ i ];
			m_vecObjectiveTrackers.Remove( i );
		}
	}
}

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CQuestItemTracker::OnRemove()
{
#ifdef GAME_DLL
	CommitRecord_t* pRecord = m_pManager->GetCommitRecord( m_pItem->GetItemID() );
	if ( pRecord )
	{
		CMsgGCQuestObjective_PointsChange* pProto = assert_cast< CMsgGCQuestObjective_PointsChange* >( pRecord->m_pProtoMsg );
		pProto->set_update_base_points( true );
	}
#endif
}

void CQuestItemTracker::Spew() const 
{
	CBaseSOTracker::Spew();

	FOR_EACH_VEC( m_vecObjectiveTrackers, i )
	{
		DevMsg( "Tracking objective: %d\n", m_vecObjectiveTrackers[ i ]->GetObjectiveDefIndex() );
	}
}

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
bool CQuestItemTracker::DoesObjectiveNeedToBeTracked( const CQuestObjectiveDefinition* pObjective ) const
{
	auto pQuestDef = m_pItem->GetItemDefinition()->GetQuestDef();

	Assert( pObjective );
	if ( pObjective && pQuestDef )
	{
		// If there's standard points to be earned, all objectives need to be tracked
		if ( pQuestDef->GetMaxStandardPoints() > 0 && GetEarnedStandardPoints() < pQuestDef->GetMaxStandardPoints() )
		{
			return true;
		}

		// If this objective is advanced, only track it if there's bonus points to be earned
		if ( pObjective->IsAdvanced() )
		{
			return pQuestDef->GetMaxBonusPoints() > 0 && GetEarnedBonusPoints() < pQuestDef->GetMaxBonusPoints();
		}
	}

	return false;
}

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CQuestItemTracker::CommitChangesToDB()
{
#ifdef CLIENT_DLL
	if ( GetQuestLog() && GetTrackedPlayer() == C_TFPlayer::GetLocalTFPlayer() )
	{
		GetQuestLog()->MarkQuestsDirty();
	}
#else // GAME_DLL

	// Nothing to commit?  Bail
	if ( m_nStandardPoints == 0 && m_nBonusPoints == 0 )
		return;

	SO_TRACKER_SPEW( CFmtStr( "CommitChangesToDB: %llu S:%d B:%d\n"
			, m_pItem->GetItemID()
			, GetEarnedStandardPoints()
			, GetEarnedBonusPoints() ), 0 );
	
	CSteamID ownerSteamID( m_pItem->GetAccountID(), GetUniverse(), k_EAccountTypeIndividual );

	CMsgGCQuestObjective_PointsChange record;

	// Cook up our message
	record.set_owner_steamid( ownerSteamID.ConvertToUint64() );
	record.set_quest_item_id( m_pItem->GetItemID() );
	record.set_standard_points( GetEarnedStandardPoints() );
	record.set_bonus_points( GetEarnedBonusPoints() ); // Here's the meat

	m_pManager->AddCommitRecord( &record, record.quest_item_id(), true );
#endif
}

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
int CQuestItemTracker::IsValidForPlayer( const CTFPlayer *pOwner, InvalidReasonsContainer_t& invalidReasons ) const
{
	int nNumInvalid = 0;
	FOR_EACH_VEC( m_vecObjectiveTrackers, i )
	{
		m_vecObjectiveTrackers[ i ]->IsValidForPlayer( pOwner, invalidReasons );

		if ( !invalidReasons.IsValid() )
		{
			++nNumInvalid;
		}
	}

	return nNumInvalid;
}

#ifdef CLIENT_DLL
//-----------------------------------------------------------------------------
// Purpose: The server has changed scores.  Apply those changes here
//-----------------------------------------------------------------------------
void CQuestItemTracker::UpdateFromServer( uint32 nStandardPoints, uint32 nBonusPoints )
{
	SO_TRACKER_SPEW( CFmtStr( "Updating \"%s's\" standard points: %d->%d bonus points: %d->%d\n"
					  , m_pItem->GetItemDefinition()->GetQuestDef()->GetRolledNameForItem( m_pItem )
					  , m_nStandardPoints
					  , nStandardPoints
					  , m_nBonusPoints
					  , nBonusPoints )
					  , SO_TRACKER_SPEW_OBJECTIVES );

	m_nStandardPoints = nStandardPoints;
	m_nBonusPoints = nBonusPoints;
}
#else
void CQuestItemTracker::SendUpdateToClient( const CQuestObjectiveDefinition* pObjective )
{
	const CTFPlayer* pPlayer = GetTrackedPlayer();

	// They might've disconnected, so let's check if they're still around
	if ( pPlayer )
	{
		// Update the user on their progress
		CSingleUserRecipientFilter filter( GetTrackedPlayer() );
		filter.MakeReliable();
		UserMessageBegin( filter, "QuestObjectiveCompleted" );
		itemid_t nID = m_pItem->GetItemID();
		WRITE_BITS( &nID, 64 );
		WRITE_WORD( GetEarnedStandardPoints() );
		WRITE_WORD( GetEarnedBonusPoints() );
		WRITE_WORD( pObjective ? pObjective->GetDefinitionIndex() : (uint32)-1 );
		MessageEnd();
	}
}
#endif

#if defined( DEBUG ) || defined( STAGING_ONLY )
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CQuestItemTracker::DBG_CompleteQuest()
{
#ifdef GAME_DLL

	auto pQuestDef = m_pItem->GetItemDefinition()->GetQuestDef();
	uint32 nStandardPointsDelta = pQuestDef->GetMaxStandardPoints() - GetEarnedStandardPoints();

	// Cheat!
	if ( m_vecObjectiveTrackers.Count() )
	{
		const_cast< CBaseQuestObjectiveTracker* >( m_vecObjectiveTrackers[0] )->EvaluateCondition( NULL, nStandardPointsDelta );
	}

	CommitChangesToDB();
#endif
}
#endif