+ void NetworkConstantModel::updateActionsState(double /*now*/, double delta)
+ {
+ NetworkConstantAction *action = NULL;
+ ActionList *actionSet = getRunningActionSet();
+ for(ActionList::iterator it(actionSet->begin()), itNext=it, itend(actionSet->end())
+ ; it != itend ; it=itNext) {
+ ++itNext;
+ action = static_cast<NetworkConstantAction*>(&*it);
+ if (action->m_latency > 0) {
+ if (action->m_latency > delta) {
+ double_update(&(action->m_latency), delta, sg_surf_precision);
+ } else {
+ action->m_latency = 0.0;
+ }
+ }
+ action->updateRemains(action->getCost() * delta / action->m_latInit);
+ if (action->getMaxDuration() != NO_MAX_DURATION)
+ action->updateMaxDuration(delta);
+
+ if (action->getRemainsNoUpdate() <= 0) {
+ action->finish();
+ action->setState(SURF_ACTION_DONE);
+ } else if ((action->getMaxDuration() != NO_MAX_DURATION)
+ && (action->getMaxDuration() <= 0)) {
+ action->finish();
+ action->setState(SURF_ACTION_DONE);
+ }
+ }
+ }