[CF-Devel] new generator code

crossfire-devel-admin at archives.real-time.com crossfire-devel-admin at archives.real-time.com
Thu Sep 4 00:37:24 CDT 2003


David Delbecq wrote:

  As a note, I have no problem with the idea itself - generators being able to 
spawn inventory makes a lot of sense.  But I have some minor nits.


>
     
      --
     
     >
     
      There are 2 types of generators in crossfire since september 2003.
     
     >
     
      both are identified as generators by setting the flag "generate" to 1.
     
     >
     
      For the first type (the classical one) use "other_arch" to specify
     
     >
     
      archetype of object to be spawned.
     
     >
     
      The second type allow more fine tuning on what to generate. To activate
     
     >
     
      second type, set the flag "use_content_on_gen" to 1. Then each
     
     >
     
      time something must be generated, it will be a copy of a randomly
     
     >
     
      choosen item in the generator's inventory.
     
     
  Why use such a flag at all?  It'd be much better to just have code like 'if 
generator->inv, use generator->inv for object, otherwise use generator->other_arch'.

  I can't see any reason why that flag is needed.

  As an aside, this is a note to all developers, but things I definately saw in 
your last two checkins:

1) Please be careful about changing whitespace unecessary.  Eg, don't change 
comments, }, or whatever else unecessarily.  If you're changing the code in that 
area, fine, but there were several occasions in the last checking in which 
whitespace changed in code not anywhere close/related to other changes.  This 
may not seem like a big issue, until you realize that other people working on 
the code with modified sources - it can cause unnecessarily need to resolve 
conflicts that needs to be resolved if they have modified the code.

  I suggest that you should always run a cvs diff on the stuff before you check 
in - make sure there are not unnecesarily changes.

2) Make sure the program compiles without warnings with some reasonable strict 
checking - -Wall with gcc for example.  There was an error in the renaming code 
- was doing a cp==' ', when it should have been *cp - simple error gcc caught. 
Also catches unused variables and other behaviour.





_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     
    


More information about the crossfire mailing list