[CF-Devel] button.c magic mouth suggestions

Andreas Vogl andi.vogl at gmx.net
Sun Sep 8 05:13:29 CDT 2002


Mark W. wrote:

>
     
      [...] it would be easy to add similar code for [mood floors, directors,
     
     >
     
      teleports and creators.] Only danger for some of those is that they
     
     >
     
      may use 'sp' for something else.
     
     >
     
     
     >
     
      I'd really like to get away from overloading meanings of variables like
     
     >
     
      this. I know crossfire has done a lot of this in the past, but there is
     
     >
     
      no reason to continue to do this (other than it is slightly easier to
     
     >
     
      code).
     
     
Guess we had this topic already once, but I don't think overloading
is so bad, given the way our code currently works.
If we add new flags and variables for every object, memory
consumtion would explode and we can't afford that IMO.
The server is already seriously memory-hungry.

I could update "types.txt" for the JavaEditor and there it will
show all the "real" meanings of the fields. Nobody has to
keep in mind the overloaded variable names like sp, last_eat,
and all that. That is only the internal way values get stored.
Mapmakers have the masked GUI from the editor to understand
things. Even developers can take a look there if in doubt.

>
     
      That said, I'd much rather add something like a couple new flags ' 
     
     >
     
      FLAG_ON_BUTTON_PRESS' and FLAG_ON_BUTTON_RELEASE' or the
     
     >
     
      like (those are perhaps a bit verbose).
     
     >
     
     
     >
     
      That is much clearer than using sp, and would also mean that other
     
     >
     
      objects could use those flags without worry about possible conflicts
     
     >
     
      or the like.
     
     
In spite of what I said before, I agree to you in this case.
It would be nicer to use flags here, because they can be used
in multiple objects, as said. Though I would name them
like 'FLAG_ACTIVATE_AT_PUSH' or something.

However, the patch from Kurt already exists. The solution
with flags does not. Would you do it? Would Kurt do it?
I'd really like to have this feature - one way or the other.
And to me Kurt's patch seems quite good enough.


Andreas

-- 
GMX - Die Kommunikationsplattform im Internet.
     
     http://www.gmx.net
     
     
    


More information about the crossfire mailing list