patchFreeciv - Patches: patch #3876, Remove redundant...

Show feedback again

patch #3876: Remove redundant tile_remove_base() call

Submitted by:  Emmet Hikory <persia>
Submitted on:  Mon Apr 22 21:54:53 2013  
Category: generalPriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Marko Lindqvist <cazfi>Open/Closed: Closed
Planned Release: 2.5.0Contains string changes: None

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Sun Apr 28 20:27:50 2013, SVN revision 22787:

Removed duplicate tile_remove_base() call from tile_change_terrain()

Patch by Emmet Hikory

See patch #3876

(Browse SVN revision 22787)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Mon Apr 22 21:54:53 2013, original submission:

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 tile_remove_base().

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().

Emmet Hikory <persia>
Project Member


(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #17810:  remove-redundant-tile_remove_base-call.patch added by persia (880B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by cazfi (Updated the item)
  • -unavailable- added by persia (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Error: not logged in



    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun Apr 28 20:28:00 2013cazfiStatusReady For Test=>Done
    Mon Apr 22 22:13:53 2013cazfiStatusNone=>Ready For Test
      Assigned toNone=>cazfi
      Planned Release=>2.5.0
    Mon Apr 22 21:54:53 2013persiaAttached File-=>Added remove-redundant-tile_remove_base-call.patch, #17810
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup