# Order queueing for construction.

This was SVN commit r4497.
This commit is contained in:
Matei 2006-10-06 14:21:16 +00:00
parent 0df95f3e8f
commit 2337cb203a
5 changed files with 8 additions and 12 deletions

View File

@ -1407,6 +1407,11 @@ void CBuildingPlacer::mouseReleased()
msg->m_Angle = (u32) (m_angle * 1000);
g_Game->GetSimulation()->QueueLocalCommand(msg);
}
if( hotkeys[HOTKEY_ORDER_QUEUE] )
{
activate( m_templateName ); // reactivate so we can place more buildings of the same type
}
}
void CBuildingPlacer::deactivate()

View File

@ -71,16 +71,6 @@ bool CAStarEngine::findPath(
mGoal->setDestination(dest);
mGoal->setRadius(radius);
if( !mGoal->isPassable(src, player) )
{
return false;
}
if( radius==0 && !mGoal->isPassable(dest, player) )
{
return false;
}
AStarNode *start = getFreeASNode();
start->coord = mGoal->getTile(src);
start->parent = NULL;

View File

@ -675,6 +675,7 @@ bool CEntity::Initialize()
CEventInitialize evt;
if( !DispatchEvent( &evt ) )
{
debug_printf("start construction failed, killing self\n");
kill();
return false;
}

View File

@ -12,7 +12,7 @@
class CEventInitialize : public CScriptEvent
{
public:
CEventInitialize() : CScriptEvent( L"initialize", EVENT_INITIALIZE, false ) {}
CEventInitialize() : CScriptEvent( L"initialize", EVENT_INITIALIZE, true ) {}
};
class CEventDeath : public CScriptEvent

View File

@ -370,7 +370,7 @@ uint CSimulation::TranslateMessage(CNetMessage* pMsg, uint clientMask, void* UNU
// Order all the selected units to work on the new object using the given action
order.m_type = CEntityOrder::ORDER_START_CONSTRUCTION;
order.m_data[0].entity = newObj;
QueueOrder(order, msg->m_Entities, false);
QueueOrder(order, msg->m_Entities, isQueued);
}
} while(0)
break;