Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Feature #871170

defense_multiplication(): Rework to take defender unit instead of unit type

Added by Marko Lindqvist over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
General
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Make defense_multiplication() to take individual defender unit instead of unit type. Check unit's fortified status from the unit itself instead of getting it as a parameter.

In the future this will allow getting fortified defense bonus from the effects system as unit can be used by the requirements system to get the unit properties (such as fortified status) the standard way.


Related issues

Related to Freeciv - Feature #867744: Unhardcode fortifying rulesClosed

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Blocked by Freeciv - Feature #870914: Const unittype and improvementClosed

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#2 Updated by Marko Lindqvist over 2 years ago

#3 Updated by Marko Lindqvist over 2 years ago

#4 Updated by Marko Lindqvist over 2 years ago

  • Status changed from Resolved to In Progress

This should be only a refactoring, but it makes autogames to differ.

#5 Updated by Marko Lindqvist over 2 years ago

It turns out that unit_virtual_create() & unit_virtual_destroy() pair changes game state. Factoring that out from the test, autogames produce identical results.

New version of the patch attached regardless. This version also sets ptile as the virtual unit tile, just in case.

#6 Updated by Marko Lindqvist over 2 years ago

  • Status changed from Resolved to Closed
  • Assignee set to Marko Lindqvist

Also available in: Atom PDF