[Freeciv-Dev] (PR#4674) small clean up in unit vision range calculations
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
[bursig - Thu Jul 24 22:15:33 2003]:
> This is small clean up that remove some duplicate code.
Nice idea. I have often wondered why something like this wasn't already
written; now I know there was no reason :-).
I have cleaned your patch up a little bit:
- First off, get_unit_vision_range should call
unit_profits_of_watchtower and get_watchtower_vision rather than
calculating this manually. This means this function needs to go into
the server code, which is where it belongs (clients apparently don't
know about watchtowers). In the future all three functions could be
moved back into unit.[ch] if the clients need it.
- You've fixed several apparent bugs along with your cleanups. I've
removed the bugfixes. This patch should now be very straightforward.
After it goes in we should do a full audit for the use of
unittype->vision_range instead of get_unit_vision_range.
- I removed the arbitrary cleanups - e.g. reordering struct fields.
- Some added comments and style fixes.
jason
vision_range-2.diff
Description: vision_range-2.diff
|
|