The Mud Connector

Author Topic: sorting inventory by type  (Read 1801 times)

Xander Carinus

  • New to TMC
  • *
  • Posts: 29
    • View Profile
    • Carinus
sorting inventory by type
« on: April 16, 2018, 1:40 AM »
i am using a smaugFUSS base and was wondering if anyone knew how to sort inventory by type?
If killing them with kindness doesn't work, a sword works pretty well.

Vladaar07

  • New to TMC
  • *
  • Posts: 31
    • View Profile
    • Classic 6Dragons
Re: sorting inventory by type
« Reply #1 on: April 16, 2018, 5:41 PM »
sure

Run it through a loop

    OBJ_DATA               *findobj, *findobj_next;

    for(findobj = ch->first_carrying; findobj != NULL; findobj = findobj_next)
    {
      findobj_next = findobj->next_content;

Have a case statement here that looks for findobj->item_type