Bug 270353 - Background colors are the same for all players, many planet names show up as a rectangle, rather than a letter or number
Summary: Background colors are the same for all players, many planet names show up as ...
Status: RESOLVED FIXED
Alias: None
Product: konquest
Classification: Applications
Component: general (show other bugs)
Version: 2.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Pierre Ducroquet
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-07 19:52 UTC by Rob Ferguson
Modified: 2011-09-02 17:19 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Color depends on player number not on generated name number (1.96 KB, patch)
2011-05-07 22:35 UTC, Sebastian Kühn
Details
Fix (3.10 KB, patch)
2011-09-01 19:37 UTC, Jeffrey Kelling
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Ferguson 2011-04-07 19:52:54 UTC
Version:           2.0 (using KDE 4.5.1) 
OS:                Linux

Hard to tell which planets are mine because all players show up as the same color background.
Fonts are messed up because many planet names show up as a rectangle, rather than a letter or number.

Reproducible: Always

Steps to Reproduce:
Start Konquest, click new game, choose any number of planets, any grid size, play.



OS: Linux (x86_64) release 2.6.35-28-generic
Compiler: cc
Comment 1 Frederik Schwarzer 2011-04-08 10:05:55 UTC
I cannot test 4.5 but it looks fine here in 4.4.5 and 4.6.1.

Can you please attach a screen shot of the game? Maybe someone can tell what might be wrong by the looks.

Regards
Comment 2 Sebastian Kühn 2011-05-07 22:35:48 UTC
Created attachment 59747 [details]
Color depends on player number not on generated name number

I can confirm this bug. To reproduce:
* Create a new game
* add a player (blue color)
* change name to smth. different (e.g foo)
* add another player (again blue color)

The color and player number depend on the number of the generated unique name. The attached patch changes this behavior and creates a new function to return a unique name. The color selection is independ of this function.

The last hunk is a hack as the svn version crashed with an out of index exception.
With this hack the new dialog works even if index is -1, but this might introduce a new bug.
I think the conditional should be index >=0 and index - 1 should only be index but I've not digged deeper into the code and don't fully understand the purpose of the function.
Comment 3 Frederik Schwarzer 2011-05-08 00:01:04 UTC
Meh, just read your text, dug into the code and fixed the crash ... and then found your patch and saw that you came to the same conclusion. Sorry for the missing credits. :/
Comment 4 Pierre Ducroquet 2011-08-12 22:49:35 UTC
Bug fixed by schwarzer...
Comment 5 Jeffrey Kelling 2011-09-01 19:36:13 UTC
As far as I see this bug is not fixed in the SVN (trunk) nor in 4.6.2.

The attached patch for 05-07 should introduce a similar bug when players are removed.

I will attach a patch that fixes it.

Btw. the game does at no point care for unique player names, why here?
Comment 6 Jeffrey Kelling 2011-09-01 19:37:34 UTC
Created attachment 63292 [details]
Fix
Comment 7 Stefan Majewsky 2011-09-02 16:41:34 UTC
Nothing fixed here, so back to UNCONFIRMED. schwarzer fixed a crash which was also fixed by the crash, but that is not related to the actual bug.
Comment 8 Stefan Majewsky 2011-09-02 17:19:43 UTC
Jeffrey fixed the remaining bugs in trunk. No backport to 4.7 at the moment because the patch is quite involved. Any other opinions on that?