Summary: Remove redundant tile_remove_base() call
                 Project: Freeciv
            Submitted by: persia
            Submitted on: Tue 23 Apr 2013 06:54:53 AM JST
                Category: general
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 



Extracted from discussion in patch #3826

tile.c:tile_change_terrain() checks if fc_funcs->destroy_base is set, and
either calls the callback or calls tile_remove_base() if the callback is
unset.  Then, just to make sure, tile_remove_base() is called again. 
fc_funcs->destroy_base is set to NULL for the client and
maphand.c:destroy_base() for the server, which function also calls

In practice, this means that for calls from the client, tile_remove_base() is
called twice in immediate succession within tile_change_terrain(), and for
calls from the server, tile_remove_base() is called from destroy_base() and
then immediately thereafter from tile_change_terrain().

This patch removes the redundant call and adds a comment indicating that the
code assumes that tile_remove_base() will be called by any function assigned
to fc_funcs->destroy_base().


File Attachments:

Date: Tue 23 Apr 2013 06:54:53 AM JST  Name:
remove-redundant-tile_remove_base-call.patch  Size: 880B   By: persia



Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to