View Single Post
  #9  
Old 05-10-2004, 04:52 PM
m0oni9
Hill Giant
 
Join Date: Dec 2003
Posts: 166
Default

Couple small suggestions, take for what you will : unless you need to #define language values for some reason (and even then this might be preferable), use enum, ie:

Code:
enum {
  LANG_COMMON_TONGUE,
  LANG_BARBARIAN,
  ..etc..,
  LANG_MAX
};
Modified function slightly. Returns true on success, false on error.

Code:
bool Client::SetLanguage(unsigned int langid, unsigned int value) 
{
   if (langid >= LANG_MAX) 
      return false;

   if (value <= 100)
   {
      m_pp.languages[langid] = value;

      Message_StringID( 270, 449 );
   }

  return true;
}
Reply With Quote