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

Bug #870631

Several unique units may be given to a player

Added by Alexandro Ignatiev over 2 years ago. Updated about 2 months ago.

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

0%

Estimated time:

Description

Three cases when you can get a pair of unique units (maybe split):
1. Consider you have defined an unique unit of some starting role first in your ruleset and that any other units of this role are not buildable. If you have two letters of this role in your starting units, you get two such units.
2. Start a game and type command (fill any livable inner coords in place of 48,65)

/lua cmd edit.create_unit(find.player(0), find.tile(48,65), find.unit_type'Leader', 0, nil, -1)

Type it again. Now you have two leaders.
3. Just put a dozen of leaders in editing mode.

Somebody would say it's feature but having NOT MORE THAN ONE unique unit is assumed in so many places that it's probably a bug.

Analysis of 1: The function that gives these units is crole_to_unit_type() in server/gamehand.c: if it fails grant a buildable unit of the role to the player, it just takes the first ruleset's one resorting to get_role_unit() in common/unittype.c, and that function (used elsewhere, don't change) does not care about uniqueness.

History

#1 Updated by Marko Lindqvist almost 2 years ago

  • Tracker changed from Task to Bug

#2 Updated by Marko Lindqvist over 1 year ago

  • Sprint/Milestone changed from 2.6.3 to 2.6.4

#3 Updated by Marko Lindqvist over 1 year ago

  • Sprint/Milestone changed from 2.6.4 to 2.6.5

#4 Updated by Marko Lindqvist about 1 year ago

  • Sprint/Milestone changed from 2.6.5 to 2.6.6

#5 Updated by Marko Lindqvist 8 months ago

  • Sprint/Milestone changed from 2.6.6 to 3.0.1

#6 Updated by Marko Lindqvist 4 months ago

  • Sprint/Milestone changed from 3.0.1 to 3.0.2

Alexandro Ignatiev wrote:

Somebody would say it's feature but having NOT MORE THAN ONE unique unit

That's whey they are called UNIQUE units. There should be no argument about having "multiple similar unique" unit being a bug.

#7 Updated by Marko Lindqvist 3 months ago

Alexandro Ignatiev wrote:

1. Consider you have defined an unique unit of some starting role first in your ruleset and that any other units of this role are not buildable. If you have two letters of this role in your starting units, you get two such units.

-> https://osdn.net/projects/freeciv/ticket/44685

#8 Updated by Marko Lindqvist 2 months ago

  • Sprint/Milestone changed from 3.0.2 to 3.0.3

Alexandro Ignatiev wrote:

3. Just put a dozen of leaders in editing mode.

-> https://osdn.net/projects/freeciv/ticket/44793

This leaves the lua case to this ticket.

#10 Updated by Marko Lindqvist about 2 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF