[crossfire] material type issue

Mark Wedel mwedel at sonic.net
Sat Jan 22 02:47:28 CST 2005


Andreas Kirschbaum wrote:
>>
     
     I've noticed that if I buy a bunch of stuff from a table (like
     
     >>
     
     alchemical elements), they don't have a material type, but if I leave
     
     >>
     
     them in my apartment and come back after the map has been saved, the
     
     >>
     
     material type is set. This means that newly-bought items don't merge
     
     >>
     
     with older items (and they're indestructible).
     
     >>
     
     
     >>
     
     Is this something that is easily fixed?
     
     >
     
     
     >
     
     
     >
     
      I had the same problem while checking the Python plugin. The attached
     
     >
     
      patch fixed the problem for me, but I don't know if using a fixed
     
     >
     
      difficulty (5) is correct.
     
     
  I don't think modifying the arch_to_object function is really the right 
approach.  IMO, the arch_to_object function should really just do the basic 
'make an object out of this arch' - it should do other customizations.

  I'd make the case that it is the convert_item() function that should make that 
call, probably in fact calling fix_generated_item().

  Adding a call to fix_generated_item() should also mean healing potions 
generated by tables would then work, as fix_generated_item() would then do the 
work of processing its treasure list and putting the correct spell object in it.


>
     
     
     >
     
     
     >
     
      ------------------------------------------------------------------------
     
     >
     
     
     >
     
      Index: common/arch.c
     
     >
     
      ===================================================================
     
     >
     
      RCS file: /cvsroot/crossfire/crossfire/common/arch.c,v
     
     >
     
      retrieving revision 1.29
     
     >
     
      diff -w -c -5 -r1.29 arch.c
     
     >
     
      *** common/arch.c	27 Oct 2003 07:24:13 -0000	1.29
     
     >
     
      --- common/arch.c	20 Jan 2005 22:30:37 -0000
     
     >
     
      ***************
     
     >
     
      *** 571,580 ****
     
     >
     
      --- 571,581 ----
     
     >
     
            return NULL;
     
     >
     
          }
     
     >
     
          op=get_object();
     
     >
     
          copy_object(&at->clone,op);
     
     >
     
          op->arch=at;
     
     >
     
      +   set_materialname(op, 5, NULL);
     
     >
     
          return op;
     
     >
     
        }
     
     >
     
     
     >
     
        /*
     
     >
     
         * Creates an object.  This function is called by get_archetype()
     
     >
     
     
     >
     
     
     >
     
      ------------------------------------------------------------------------
     
     >
     
     
     >
     
      _______________________________________________
     
     >
     
      crossfire mailing list
     
     >
     
     
      crossfire at metalforge.org
      
      
     >
     
     
      http://mailman.metalforge.org/mailman/listinfo/crossfire
      
      
     
    


More information about the crossfire mailing list