Ahh, a very good way of handling ArmyData::PerformOrderHere there, I think
. At least it is cleaner than just disabling pathing for bombard orders altogether.

#if !defined(ACTIVISION_ORIGINAL) //---------------------------------------------------------------------------- // // Name : ArmyData::GetBombardRange // // Description: Test if this army can bombard. Fill in min_rge and max_rge. // // Parameters : sint32 & min_rge : the min of the bombard ranges of this army's units // : sint32 & max_rge : the max of the bombard ranges of this army's units // // Globals : - // // Returns : bool // // Remark(s) : min_rge is not used yet, pft // // Called by : ArmyData::PerformOrderHere, ArmyData::Bombard // //---------------------------------------------------------------------------- bool ArmyData::GetBombardRange(sint32 & min_rge, sint32 & max_rge) { sint32 i; min_rge = 99999; max_rge = 0; for(i = 0; i < m_nElements; i++) { const UnitRecord *rec = g_theUnitDB->Get(m_array[i]->GetType()); sint32 rge; rec->GetBombardRange(rge); if(rge){ if(rgemax_rge) max_rge = rge; } } if(max_rge > 0) return true; return false; } #endif
#if defined(ACTIVISION_ORIGINAL) if(!point.IsNextTo(m_pos)) { #else sint32 dist = MapPoint::GetSquaredDistance(m_pos,point); dist = sqrt(dist); sint32 min_rge, max_rge; GetBombardRange(min_rge,max_rge); if(dist > max_rge) {//the target is out of this army's bombarding range #endif return ORDER_RESULT_ILLEGAL; }
Comment