<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40184 >

> [book - Wed Jun 11 19:56:11 2008]:
> > [EMAIL PROTECTED] - Wed Jun 11 16:51:03 2008]:
> > 
> >  - Add FIXME about the fact that following code is not
> > generic enough (gen-movement)
> > 
> > +  coastal = is_sailing_unittype(punittype);
> > +  homecity = find_closest_owned_city(pplayer, ptile, coas...
> This is a direct conversion of the old can_unit_exist_at_tile
> to work on unit_type's (needed for example to check if a unit
> type can be created at a certain tile).
> I'll add the FIXME here, but generalizing this code really
> belongs in another ticket.

Sorry, I mistook the code snippet for a different one
that looks similar. :(

This of course refers to code in handle_edit_unit_create,
and has nothing to do with can_unit_exist_at_tile (except
that they both use is_sailing_unittype).

So my question is: isn't is_sailing_unittype as general
as this code can be? Since it calls utype_move_type
which calls uclass_move_type, and checks for SEA_MOVING
which corresponds to move_type = "Sea" in the unitclass_sea
section of the units.ruleset file.

How else should I check to make sure that created "boats"
are not homed to land-locked cities?


Freeciv-dev mailing list

Reply via email to