| 218 | } |
| 219 | |
| 220 | cOrgSensor::sLookOut cOrgSensor::FindResCenter(cAvidaContext& ctx, const int res_id, const int distance_sought, const int facing) |
| 221 | { |
| 222 | sLookOut res_search; |
| 223 | res_search.report_type = 1; |
| 224 | res_search.habitat = -2; |
| 225 | res_search.id_sought = res_id; |
| 226 | res_search.search_type = -9; |
| 227 | |
| 228 | int target_cell = m_organism->GetOrgInterface().GetCellID(); |
| 229 | if (m_use_avatar) target_cell = m_organism->GetOrgInterface().GetAVCellID(); |
| 230 | |
| 231 | cResourceCount* res_count = m_organism->GetOrgInterface().GetResourceCount(); |
| 232 | if (res_search.distance != -1) { |
| 233 | if (m_world->GetEnvironment().GetResourceLib().GetResource(res_id)->GetGradient()) { |
| 234 | target_cell = res_count->GetCurrPeakX(ctx, res_id) + (res_count->GetCurrPeakY(ctx, res_id) * m_world->GetConfig().WORLD_X.Get()); |
| 235 | } |
| 236 | } |
| 237 | FindThing(target_cell, distance_sought, facing, res_search); |
| 238 | return res_search; |
| 239 | } |
| 240 | |
| 241 | void cOrgSensor::FindThing(int target_cell, const int distance_sought, const int facing, sLookOut& thing_search, cOrganism* target_org) |
| 242 | { |
nothing calls this directly
no test coverage detected