00001 00032 #include "llviewerprecompiledheaders.h" 00033 00034 #include "llhippo.h" 00035 00036 #include "llchat.h" 00037 00038 #include "llagent.h" 00039 #include "llviewerregion.h" 00040 #include "llfloaterchat.h" // for add_chat 00041 00042 void trigger_hippo_bug(void*) 00043 { 00044 BOOL chat = FALSE; 00045 LLViewerRegion* region = gAgent.getRegion(); 00046 const char* name = (region ? region->getName().c_str() : NULL); 00047 00048 if (name) 00049 { 00050 if ( name[0] == 'A' 00051 || name[0] == 'E' 00052 || name[0] == 'I' 00053 || name[0] == 'O' 00054 || name[0] == 'U') 00055 { 00056 chat = TRUE; 00057 } 00058 else if (ll_frand() > 0.5f) 00059 { 00060 chat = TRUE; 00061 } 00062 } 00063 00064 if (chat) 00065 { 00066 LLChat chat("hippos!"); 00067 chat.mFromName = "Ghostly Bug"; 00068 LLFloaterChat::addChat(chat); 00069 } 00070 }