void Action_queue::create_action(Action_data data) { Action* a = new Action(this, core->get_file_system_engine(), data); connect(a, SIGNAL(finished()), this, SLOT(action_finished())); //QMutexLocker locker(&access_mutex); actions << a; emit action_added(a); if (!isRunning()) { QTimer::singleShot(0, a, SLOT(run())); start(); } }
//--------- Begin of function Nation::action_failure --------// // // It's basically the same as action_finish(). Now there isn't any // difference. // // <WORD> aiActionId - the id. of the action to be marked finished. // [short] unitRecno - if this is given, the the unit's all action // will be stopped. // void Nation::action_failure(WORD aiActionId, short unitRecno) { //-- if the unit is a ship, ignore it as it will be called by stop2() when it stops, but hasn't yet finished its action --// /* Unit* unitPtr = unit_array[unitRecno]; if( unit_res[unitPtr->unit_id]->unit_class == UNIT_CLASS_SHIP ) { int actionMode = get_action_based_on_id(aiActionId)->action_mode; if( actionMode == ACTION_AI_SEA_TRAVEL || actionMode == ACTION_AI_SEA_TRAVEL2 ) { return; } } */ //------------------------------------------------// action_finished(aiActionId, unitRecno, 1); // 1 - action failure }