![]() |
CTP2 Bureau The Modding Knowledgebase |
|
Apolyton CTP2 forums Apolyton CTP2 archives Source Code Project SVN |
![]() |
Search the site: |
SLIC-Reference :
|
Arguments: | string1, string2 |
Returns true if string1 equals string2 |
This function did not work as supposed in the original game and has been fixed by Martin Gühmann for CTP2 AE. In addition it has been overloaded to allow the comparison of strings passed as strings, string IDs and builtin variables containing strings. |
SFN_ERROR Slic_StringCompare::Call(SlicArgList *args) { if(args->Count() != 2) return SFN_ERROR_NUM_ARGS; //Added by Martin Ghmann to allow string comparision, between string IDs and plain strings char *string1 = 0; char *string2 = 0; const char *cstring1, *cstring2; StringId stringId1, stringId2; if(!args->GetString(0, string1)){ if(args->GetStringId(0, stringId1)){ cstring1 = g_theStringDB->GetNameStr(stringId1); } else if(args->m_argValue[0].m_type == SA_TYPE_INT_VAR){ cstring1 = g_theStringDB->GetNameStr(args->m_argValue[0].m_symbol->GetStringId()); } else{ return SFN_ERROR_TYPE_ARGS; } string1 = const_cast |
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: 105545 unique users since 02.05.2004 (» Site Statistics) Hosted by: WebhostOne |