patchFreeciv - Patches: patch #4014, process_attacker_want() veterancy...

 
 
Show feedback again

patch #4014: process_attacker_want() veterancy handling

Submitted by:  Marko Lindqvist <cazfi>
Submitted on:  Wed 17 Jul 2013 05:23:45 PM UTC  
 
Category: aiPriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Marko Lindqvist <cazfi>Open/Closed: Closed
Planned Release: 2.4.1, 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.

 

(Jump to the original submission Jump to the original submission)

Wed 09 Oct 2013 08:29:19 AM UTC, SVN revision 23559:

Fixed ai evaluation if attacker would be built as veteran by using
actual effect value. Old check also gave reversed results.

See patch #4014

(Browse SVN revision 23559)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Wed 09 Oct 2013 08:28:30 AM UTC, SVN revision 23558:

Fixed ai evaluation if attacker would be built as veteran by using
actual effect value. Old check also gave reversed results and
didn't support multiple veterancy levels.

See patch #4014

(Browse SVN revision 23558)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Wed 09 Oct 2013 08:28:23 AM UTC, SVN revision 23557:

Fixed ai evaluation if attacker would be built as veteran by using
actual effect value. Old check also gave reversed results and
didn't support multiple veterancy levels.

See patch #4014

(Browse SVN revision 23557)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Mon 26 Aug 2013 08:27:09 AM UTC, comment #3:

New version for TRUNK (not for S2_5):
- Updated against svn

(file #18768)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sat 27 Jul 2013 07:33:31 AM UTC, comment #2:

- S2_4 version

(file #18431)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Mon 22 Jul 2013 10:46:09 AM UTC, comment #1:

Old code is actually completely wrong. Thus I'm setting 2.4 target too for the fix.

dai_find_source_building() used by old code does not return what city currently has, but what it should build. So the result is reversed to what is needed here - if city has no barracks, barracks is returned and units are expected to be built as veteran, if city has barracks, they cannot be built any more and units are expected not to be built as veterans.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Wed 17 Jul 2013 05:23:45 PM UTC, original submission:

process_attacker_want() gets veterancy of the unit considered to be built as boolean (though stored in int variable) based on if the city has building providing EFT_VETERAN_BUILD effect for the unit. This boolean values is then passed on as veterancy level.

Attached patch makes it to use real EFT_VETERAN_BUILD effect value. This is more correct in several ways:
- Effect value can be other than 1, including multiple effects cancelling each other to result of 0
- Effect can be provided by something else than building in the city (even in supplied rulesets some wonders can provide it while positioned in another city)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cazfi (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 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 09 Oct 2013 08:29:34 AM UTCcazfiStatusReady For Test=>Done
      Assigned toNone=>cazfi
      Open/ClosedOpen=>Closed
    Mon 26 Aug 2013 08:27:09 AM UTCcazfiAttached File-=>Added ProcessAttackerVeterancy-2.patch, #18768
    Sat 27 Jul 2013 07:33:31 AM UTCcazfiAttached File-=>Added ProcessAttackerVeterancy-S2_4.patch, #18431
      StatusIn Progress=>Ready For Test
    Mon 22 Jul 2013 10:46:09 AM UTCcazfiStatusReady For Test=>In Progress
      Planned Release2.5.0, 2.6.0=>2.4.1, 2.5.0, 2.6.0
    Wed 17 Jul 2013 05:23:45 PM UTCcazfiAttached File-=>Added ProcessAttackerVeterancy.patch, #18317
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup