Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warship soldier capacity can't be set to 0 if ship still has wares #6330

Open
bunnybot opened this issue Jan 29, 2024 · 2 comments · May be fixed by #6422
Open

Warship soldier capacity can't be set to 0 if ship still has wares #6330

bunnybot opened this issue Jan 29, 2024 · 2 comments · May be fixed by #6422
Labels
bug Something isn't working military Soldiers, military sites, training sites & battles seafaring Ships, ports, naval invasions, …

Comments

@bunnybot
Copy link

bunnybot commented Jan 29, 2024

tothxaMirrored from Codeberg
Created on Mon Jan 29 03:25:15 CET 2024 by Tóth András (tothxa)


Describe the bug
If a transport ship that carries some wares is refitted to warship, its soldier capacity can not be set below the number of on-board wares. The cause is Ship::min_warship_soldier_capacity(). I'm not sure if it would be safe to allow 0 also when ship is not yet a warship: Could onboard transported soldiers be a problem when the refit is completed?

To reproduce
Steps to reproduce the behavior:

  1. Find a transport ship that carries some wares
  2. Refit to warship
  3. Try to set soldier capacity to 0 before it reaches the refitting port
  4. See error

Expected behavior
Soldier capacity should be settable to 0.

Version:

  • OS: antix/Debian buster + backports
  • Widelands Version: protected/navalwarfare
@bunnybot bunnybot added bug Something isn't working military Soldiers, military sites, training sites & battles seafaring Ships, ports, naval invasions, … labels Jan 29, 2024
@bunnybot
Copy link
Author

tothxaMirrored from Codeberg
On Mon Jan 29 14:27:26 CET 2024, Tóth András (tothxa) wrote:


I tested it, and refitting with onboard soldiers while capacity is set to 0 doesn't seem to cause any problems.

<@>Nordfriese Do you think it's OK?

Next I'm looking into hiding the soldier level icons until the ship is refitted, for better consistency.

@bunnybot
Copy link
Author

NordfrieseMirrored from Codeberg
On Mon Jan 29 15:02:31 CET 2024, Benedikt Straub (Nordfriese) wrote:


+1 for implementing this properly. Always allowing a soldier capacity of 0 for transport ships shouldn't cause any problems I think.

@bunnybot bunnybot linked a pull request Mar 29, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working military Soldiers, military sites, training sites & battles seafaring Ships, ports, naval invasions, …
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant