[Freeciv-Dev] Re: [Patch] Watchtower version 2
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
--- Bert Buchholz <bertbuchholz@xxxxxx> wrote:
> On Mon, Aug 27, 2001 at 03:16:48PM +0100, Gregory Berkolaiko wrote:
> > Problems:
> > 1. Upgrading part is not handled correctly.
> I suppose you mean this part from upgrade_unit()? Hmm, I can't see
> anything wrong with it.
> ´punit->type = to_unit;
> if (map_get_tile(punit->x, punit->y)->special & S_FORTRESS
> && unit_profits_of_watchtower(punit))
> unfog_area(pplayer, punit->x, punit->y,
> `--- ^^^^^
this part is problematic
range was obtained without checking for
at least this is what I thought when writing the email.
> really carefully, but I still don't know what you mean. Maybe another
> hint? Am I getting on your nerves already? :-)
It's actually my fault, I should have been more explicit. Sorry.
> Thanks, it's incredible how much you can overlook if you're not really
> into that code. :-) One part I found was the waking up from sentry and
> 2nd cancelling patrol. I hope, there are no more, I think I went
yep, I remember those. Don't remember anything else yet :)
> all of them, but well you know, after all, I'm just a... ah, you know
> that one? Shit! ;-)
yep, "you are a simple Pole on a complex plane"
> > > unfog_area(unit_owner(punit), punit->x, punit->y,
> > > get_vision_range(punit));
> > > ^^^^^^^^^^^^^^^^^^^^^^^
> > I think this is how the things should be done.
> > Unfortunately you will also need to pass coordinates x,y to
> > get_vision_range, not just get them from punit.
> Yes, I see, the coords must be passes as well.
> But I leave it out in this version, maybe later. I think (as others)
> that code should be extended slowly step by step.
I don't know what gurus would think about it but in my opinion this is a
very good way to do things since it localizes the actual changes to the
rules inside get_vision_range function and will therefore make things
easier to revert/update. But maybe things are sufficiently localised
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie