![]() |
CTP2 Bureau The Modding Knowledgebase |
|
Apolyton CTP2 forums Apolyton CTP2 archives Source Code Project SVN |
![]() |
Search the site: |
SLIC-Reference :
|
Arguments: | location, ID-region | Type: | int |
Returns true if location is within the given region |
SFN_ERROR Slic_IsInRegion::Call(SlicArgList *args) { Unit unit; MapPoint point; BOOL res; struct PSlicRegion region; const struct PSlicComplexRegion *cregion; if (args->Count() != 2) return SFN_ERROR_NUM_ARGS; res = args->GetPos(0, point); if(!res) return SFN_ERROR_TYPE_BUILTIN; if(args->m_argValue[1].m_type == SA_TYPE_REGION) { res = args->m_argValue[1].m_symbol->GetRegion(region); if(!res) return SFN_ERROR_TYPE_ARGS; m_result.m_int = (point.x >= region.x1 && point.x <= region.x2 && point.y >= region.y1 && point.y <= region.y2); } else if(args->m_argValue[1].m_type == SA_TYPE_COMPLEX_REGION) { res = args->m_argValue[1].m_symbol->GetComplexRegion(cregion); if(!res) return SFN_ERROR_TYPE_ARGS; for(; cregion && !m_result.m_int; cregion = cregion->next) { m_result.m_int = point.x >= cregion->x1 && point.x <= cregion->x2 && point.y >= cregion->y1 && point.y <= cregion->y2; } } else { return SFN_ERROR_TYPE_ARGS; } return SFN_ERROR_OK; } |
More information available at Apolyton here and here
Using this form you may add your own observations concerning the above item, e.g. additional hints for usage, limitations, oddities etc. Please note this is not the place for asking questions or carrying out discussions about modding - please refer to the Apolyton CTP2 Modification Forum on that purpose.
*) Required fields
No user comments yet. |
![]() |
This site is currently maintained by: BureauBert (Webmaster) Maquiladora (Manager) Legal Notice: Legal Notice Statistics: 96303 unique users since 02.05.2004 (» Site Statistics) Hosted by: WebhostOne |