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

Saved Game Bug: Cargo #4675

Closed
craigo- opened this issue Sep 19, 2019 · 4 comments
Closed

Saved Game Bug: Cargo #4675

craigo- opened this issue Sep 19, 2019 · 4 comments

Comments

@craigo-
Copy link
Contributor

craigo- commented Sep 19, 2019

Observed behaviour

When starting a new game after having loaded a saved game with certain parameters, the new game does not recognise the starting 2t of hydrogen cargo as hyperdrive fuel.

Expected behaviour

The starting 2t of hydrogen cargo is recognised as hyperdrive fuel.

Steps to reproduce

OK, this was tricky to reliably reproduce. My guess is it has something to do with some saved game parameters not being reinitialised properly when starting a new game.

  1. Start with a clean profile by deleting/renaming the Pioneer config folder (Windows: "%USERPROFILE%\Documents\Pioneer") (NB: Back up any savefiles you wish to keep! Probably safest to just rename the folder)

  2. Set resolution to something you can read, e.g. 1600x900, close and relaunch

  3. Start on Mars

  4. Comms -> Lobby: Hyperspace Fuel: 2t, Capacity: 26t used / 9t free [correct]
    04

  5. Click -1t twice to make Hyperspace Fuel: 0t, Capacity: 24t used / 11t free [correct]
    05

  6. Save as "TESTING"

  7. End game

  8. Load game ("TESTING")

  9. Comms -> Lobby: Hyperspace Fuel: 0t, Capacity: 24t used / 11t free [correct]

  10. End game

  11. Start on Mars

  12. Comms -> Lobby: Hyperspace Fuel: 0t, Capacity: 26t used / 9t free [bug!]
    12

  13. Personal Info -> Economy & Trade: Cargo: Hydrogen 2t (hydrogen is there, just not recognised as hyperspace fuel)
    13

  14. Comms -> Lobby: Buy 3t Hydrogen

  15. Personal Info -> Economy & Trade: Hydrogen 2t (orphaned), Hydrogen 3t [two entries?]
    15

My pioneer version (and OS):
The observed behaviour is present in:

  • Pioneer master (6fd8f02), approx 20190915
  • Pioneer master (4bc31ee), approx 20190812
  • Pioneer Release 20190203

The observed behaviour is not present in Pioneer Release 20180203.

OS: Windows 10 Enterprise 1809 x64

@impaktor
Copy link
Member

Thanks for nice bug report!

@sturnclaw
Copy link
Member

@Max5377 if interested, could you confirm if this bug has been fixed by #5635?

@Max5377
Copy link
Contributor

Max5377 commented Oct 19, 2023

@Web-eWorks Unrelated. I checked-out to 2019 release and in this cargo is treated as equipment (some snippets):

EquipSet.default = {
	cargo=0,
	engine=1,
	laser_front=1,
	laser_rear=0,
	missile=0,
	ecm=1,
	radar=1,
	target_scanner=1,
	hypercloud=1,
	hull_autorepair=1,
	energy_booster=1,
	atmo_shield=1,
	cabin=50,
	shield=9999,
	scoop=2,
	laser_cooler=1,
	cargo_life_support=1,
	autopilot=1,
	trade_computer=1,
	sensor = 8,
	thruster = 1
}
function EquipSet:__TriggerCallbacks(ship, slot)
	ship:UpdateEquipStats()
	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
	self:CallListener()
end

In this, for some reason, equipment(cargo) got duplicated when starting new game.
With cargo it will not work on current master, because a new system with CargoManager.lua is implemented.
I tried to replicate this with equipment with described steps on current master, but didn't got anything unusual.
So, unless this bug is still lurking somewhere in the equipment code, I think chances of that are pretty low and it's not worth the hassle of reverting to old release to test where it came from.
(Unless, you tell me to do it)

@sturnclaw
Copy link
Member

Thanks for checking! Going to close this issue as fixed/invalidated by the CargoManager code then.

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

No branches or pull requests

4 participants