Exemple #1
0
void CCommandAI::AddCommandDependency(const Command &c) {
	int cpos;
	if (c.IsObjectCommand(cpos)) {
		int refid = c.params[cpos];
		CObject* ref = (refid < uh->MaxUnits()) ? (CObject*)uh->GetUnit(refid) :
						(CObject*)featureHandler->GetFeature(refid - uh->MaxUnits());
		if (ref)
			AddDeathDependence(ref, DEPENDENCE_COMMANDQUE);
	}
}
Exemple #2
0
void CCommandAI::AddCommandDependency(const Command& c) {
	int cpos;
	if (c.IsObjectCommand(cpos)) {
		int refId = c.params[cpos];
		CObject* ref = (refId < unitHandler->MaxUnits()) ?
				static_cast<CObject*>(unitHandler->GetUnit(refId)) :
				static_cast<CObject*>(featureHandler->GetFeature(refId - unitHandler->MaxUnits()));
		if (ref) {
			AddDeathDependence(ref, DEPENDENCE_COMMANDQUE);
		}
	}
}