void C_AI_BaseNPC::OnDataChanged( DataUpdateType_t type ) { BaseClass::OnDataChanged( type ); if ( ( ShouldModifyPlayerSpeed() == true ) || ( m_flTimePingEffect > gpGlobals->curtime ) ) { SetNextClientThink( CLIENT_THINK_ALWAYS ); } #ifdef TF_CLASSIC_CLIENT if ( type == DATA_UPDATE_CREATED ) { InitInvulnerableMaterial(); } else { if ( m_iOldTeam != GetTeamNumber() ) { InitInvulnerableMaterial(); } } if ( InCond( TF_COND_BURNING ) && !m_pBurningSound ) { StartBurningSound(); } // Update conditions from last network change if ( m_nOldConditions != m_nPlayerCond ) { UpdateConditions(); m_nOldConditions = m_nPlayerCond; } #endif }
if (var1 != condition->mLastVal) return bTrue; } return !bTrue; } bool GUIObject::isConditionValid() { return !mConditions.empty(); } int GUIObject::NotifyVarChange(const std::string& varName, const std::string& value __unused) { mConditionsResult = UpdateConditions(mConditions, varName); return 0; } bool GUIObject::UpdateConditions(std::vector<Condition>& conditions, const std::string& varName) { bool result = true; const bool varNameEmpty = varName.empty(); std::vector<Condition>::iterator iter; for (iter = conditions.begin(); iter != conditions.end(); ++iter) { if(varNameEmpty && iter->mCompareOp == "modified") { string val;