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

Selling class 1 hyperdrive 4t only frees up 1t. #3117

Closed
impaktor opened this issue Aug 8, 2014 · 6 comments
Closed

Selling class 1 hyperdrive 4t only frees up 1t. #3117

impaktor opened this issue Aug 8, 2014 · 6 comments

Comments

@impaktor
Copy link
Member

impaktor commented Aug 8, 2014

Start at New Hope.
7t free.
Sell Class 1 hyperdrive (4t)
now "free: 8t" displayed in the footer, but I can still fill it with 10t.

Strangeness: This doesn't happen with class 3 hyperdrive (20t) on Earth starting ship.

Stranger than strange: Sell any and all equipment from New Hope starting ship: First item frees up 1t (no matter how big), rest of it frees up 0t. However, sell any and all equipemnt from Earth starting ship, and all works fine!

EDIT: Change startup ship on Earth to Pumpkinseed and same strangeness happens there.

@impaktor
Copy link
Member Author

impaktor commented Aug 8, 2014

OK, I'm not familiar with data/ships/*.lua, but changing capacity from 17 to 10, so it has the same value as cargo (as it is the case for Natrix and Sinonatrix) seems to fix this problem. I don't have time to understand why, or what those variables are supposed to do in the first place.

@laarmen
Copy link
Contributor

laarmen commented Aug 10, 2014

OK. After investigation, I should say that the bug is NOT in the code. What happens is that the "cargo capacity" gauge doesn't directly use the capacity, but the totalCargo property.

    if slot == "cargo" then -- TODO: build a proper property system for the slots
        ship:setprop("usedCargo", self.slots.cargo.__occupied)
    else
        ship:setprop("totalCargo", math.min(self.slots.cargo.__limit, self.slots.cargo.__occupied+ship.freeCapacity))
    end

So when you have the 4t drive, plus all the goodies, totalCargo is the m_stats.free_capacity + usedCargo, but when you remove it, bam, the slot size becomes the new limit.

@laarmen
Copy link
Contributor

laarmen commented Aug 10, 2014

AKA:

It's not a bug, it's a feature ;-)

@lwho
Copy link
Contributor

lwho commented Sep 12, 2014

The conclusions from IRC seem to be

  • No bug in code
  • No bug in pumpkinseed
  • But confusing display

Possible resolution: Split the display of free tonnage in two numbers:

  • total available
  • available for cargo

Now we need a volunteer implementing it ;)

@PVJeltz
Copy link
Contributor

PVJeltz commented Oct 31, 2014

Hi,
I take this as a warmup :) assign to me please.

@fluffyfreak
Copy link
Contributor

Glad to see you're interested @PVJeltz feel free to work on it and ask us anything you need to know either here or on our devloper forum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants