patchFreeciv - Patches: patch #4296, Remove incorrect assertion for...

 
 
Show feedback again

patch #4296: Remove incorrect assertion for non-null nationality

Submitted by:  Guillaume Melquiond <silene>
Submitted on:  Thu 07 Nov 2013 09:35:40 PM UTC  
 
Category: clientPriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Marko Lindqvist <cazfi>Open/Closed: Closed
Planned Release: 2.5.0, 2.6.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Fri 22 Nov 2013 01:07:46 AM UTC, SVN revision 23763:

Removed assertion about unit having nationality set. That's not always true client side.

Patch by Guillaume Melquiond

See patch #4296

(Browse SVN revision 23763)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Fri 22 Nov 2013 01:07:40 AM UTC, SVN revision 23762:

Removed assertion about unit having nationality set. That's not always true client side.

Patch by Guillaume Melquiond

See patch #4296

(Browse SVN revision 23762)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Fri 08 Nov 2013 03:05:38 AM UTC, comment #2:

Sorry for the ambiguous sentence. Server-side, nationality is indeed always non-null. What I meant is that some units received by the clients from the server have their nationality set to null, e.g. enemy units.

Guillaume Melquiond <silene>
Fri 08 Nov 2013 12:41:32 AM UTC, comment #1:

> several places of the server code purposely sets the
> nationality to null


Where that happens? I think units should always have nationality set in server side.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Thu 07 Nov 2013 09:35:40 PM UTC, original submission:

unit.c:unit_nationality checks that the nationality of the unit is non-null before returning it. This assertion is incorrect since several places of the server code purposely sets the nationality to null. (And the client code expects the result of the function to be possibly null and test for it anyway.) For example, when a diplomat investigates a city, there is a flood of assertion failures in the console, since the nationality of enemy units is always hidden from the clients.

Guillaume Melquiond <silene>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #19333:  nationality.patch added by silene (371B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cazfi (Posted a comment)
  • -unavailable- added by silene (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.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 22 Nov 2013 01:08:01 AM UTCcazfiStatusReady For Test=>Done
      Open/ClosedOpen=>Closed
    Fri 08 Nov 2013 05:59:02 AM UTCcazfiStatusNone=>Ready For Test
      Assigned toNone=>cazfi
      Planned Release=>2.5.0, 2.6.0
    Thu 07 Nov 2013 09:35:40 PM UTCsileneAttached File-=>Added nationality.patch, #19333
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup