bool CRollbackInfo::IsValidActionDelete(CRollbackActionBase * pAction) { // Declare variables CRollbackActionDelete * pTemp; bool bValid = true; // Get object CRollbackActionDelete * pDelete = (CRollbackActionDelete *)pAction; // Check if file isn't already in to be copied for (int i = 0; i < GetActionCount(); i++) { if (GetAction(i)->GetType() == ROLLBACKACTION_DELETE) { // Get temp object pTemp = (CRollbackActionDelete *)GetAction(i); // Check if file isn't already being deleted if (pDelete->GetLocation() == pTemp->GetLocation()) bValid = false; } } // Return value return bValid; }
bool CRollbackInfo::IsValidActionCopy(CRollbackActionBase * pAction) { // Declare variables CRollbackActionCopy * pTemp; bool bValid = true; // Get object CRollbackActionCopy * pCopy = (CRollbackActionCopy *)pAction; // Check if file isn't already in to be copied for (int i = 0; i < GetActionCount(); i++) { if (GetAction(i)->GetType() == ROLLBACKACTION_COPY) { // Get temp object pTemp = (CRollbackActionCopy *)GetAction(i); // Check if file isn't already begin copied if (pCopy->GetNewLocation() == pTemp->GetNewLocation()) bValid = false; } } // Return value return bValid; }
bool CScriptEntity::bfScriptAnimation() { if (GetScriptControl() && !GetCurrentAction() && GetActionCount()) ProcessScripts(); if ( GetScriptControl() && GetCurrentAction() && !GetCurrentAction()->m_tAnimationAction.m_bCompleted && xr_strlen(GetCurrentAction()->m_tAnimationAction.m_caAnimationToPlay)) { if (m_tpScriptAnimation == m_tpNextAnimation) return (true); #ifdef DEBUG //if (!xr_strcmp("m_stalker_wounded",*object().cName())) // Msg ("%6d Playing animation : %s , Object %s",Device.dwTimeGlobal,*GetCurrentAction()->m_tAnimationAction.m_caAnimationToPlay, *object().cName()); #endif m_tpScriptAnimation = m_tpNextAnimation; IKinematicsAnimated *skeleton_animated = smart_cast<IKinematicsAnimated*>(object().Visual()); LPCSTR animation_id = *GetCurrentAction()->m_tAnimationAction.m_caAnimationToPlay; MotionID animation = skeleton_animated->ID_Cycle(animation_id); CBlend *result = 0; for (u16 i=0; i<MAX_PARTS; ++i) { CBlend *blend = 0; if (result) { skeleton_animated->LL_PlayCycle(i,animation,TRUE,0,0); continue; } blend = skeleton_animated->LL_PlayCycle(i,animation,TRUE,ScriptCallBack,this); if (!blend) continue; result = blend; CMotionDef *MD = skeleton_animated->LL_GetMotionDef( animation ); VERIFY( MD ); if ( m_use_animation_movement_controller || MD->flags|esmRootMover ) m_object->create_anim_mov_ctrl ( blend, 0, true ); } return (true); } else { m_tpScriptAnimation.invalidate(); return (false); } }
bool Workspace::CheckBreakpoint(const behaviac::Agent* pAgent, const behaviac::BehaviorNode* b, const char* action, EActionResult actionResult) { BEHAVIAC_UNUSED_VAR(pAgent); BEHAVIAC_UNUSED_VAR(b); BEHAVIAC_UNUSED_VAR(action); BEHAVIAC_UNUSED_VAR(actionResult); #if !BEHAVIAC_RELEASE if (Config::IsSocketing()) { #if BEHAVIAC_ENABLE_PROFILING BEHAVIAC_PROFILE("Workspace::CheckBreakpoint"); #endif behaviac::string bpStr = BehaviorTask::GetTickInfo(pAgent, b, action); uint32_t bpid = MakeVariableId(bpStr.c_str()); BreakpointInfos_t::const_iterator it = m_breakpoints.find(bpid); if (it != m_breakpoints.end()) { const BreakpointInfo_t& bp = it->second; if (bp.action_result & actionResult) { int count = GetActionCount(bpStr.c_str()); BEHAVIAC_ASSERT(count > 0); if (bp.hit_config == 0 || bp.hit_config == count) { return true; } } } } #endif//#if !BEHAVIAC_RELEASE return false; }