Author Topic: consolidate() sefun fix  (Read 1410 times)

Offline z993126

  • BFF
  • ***
  • Posts: 128
    • View Profile
consolidate() sefun fix
« on: January 24, 2012, 11:58:00 PM »
The consolidate() sefun has the quirk that if it is passed arguments "a", "an", "the", or "one" by themselves, it still removes them as though they prepend another word.  This directly affects the item_list() function as well.

To correct, change lines 449..450 in the default /secure/sefun/english.c from

Code: [Select]
    if( member_array(lower_case(strip_colours(words[0])),
                ({"a", "an", "the", "one"}) ) > -1 ) words = words[1..];

to

Code: [Select]
    if( member_array(lower_case(strip_colours(words[0])),
                ({"a", "an", "the", "one"}) ) > -1 && sizeof( words ) > 1 ) words = words[1..];

This code snippet is public domain and freely usable for any purpose.