On 3/18/98 2:28 PM, Marco Paglioni (m.paglioni@ESA-GROUP.IT) stated: >i want to remove the !!MUSIC(xxxxx) e !!SOUND(xxxxxxxxx) from the buffer >that will be sent to the player if he doesn't have a PRF_SOUNDS. > >wath is the fastest way to do it? >i have a circle3pl12 with the easy color snippet > >:) >thanks MAILER CODE FOLLOWS: endOfString = text + strlen(text); while (*text) { nextMusicCode = strstr(text, "!!MUSIC"); nextSoundCode = strstr(text, "!!SOUND"); nextCode = MIN(nextMusicCode ? nextMusicCode : endOfString, nextSoundCode ? nextSoundCode : endOfString); while (text < nextCode) { *outText++ = *text++; } if ((nextOut = strstr(text, ")"))) text = nextOut; } *outText = '\0'; That, when PROPERLY placed in a function should remove all occurences of !!MUSIC(*) and !!SOUND(*)... I think :-) Probably some bugs in there somewhere. (like I said its mailer code - standard disclaimer applies: you use anything, you lose anything, I didn't do it. No technical support available, so don't mail me with problems). - Chris Jacobson +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST