Page 1 of 1

SPEC Capacitors SVN 13248

Posted: Fri Nov 25, 2011 2:03 pm
by Hicks
Buying or selling SPEC capacitors in a base does not seem to update the warp capacitor bank storage value. After a short flight and landing at another base it seemed to update, but after buying a new SPEC capacitor it failed to update again.

Re: SPEC Capacitors SVN 13248

Posted: Fri Nov 25, 2011 7:48 pm
by pheonixstorm
svn trunk or my branch?

Re: SPEC Capacitors SVN 13248

Posted: Sat Nov 26, 2011 12:29 am
by Hicks
trunk

edit: both actually, so i guess the problem is steming from the trunk

Re: SPEC Capacitors SVN 13248

Posted: Sat Nov 26, 2011 9:12 am
by TBeholder
The way to reproduce:
  1. Visit any base/planet and buy a non-milspec ship.
  2. Look at stats.
  3. Sell its warp cap.
  4. Look at stats. Warp capacitance decreased.
  5. Buy the warp cap back.
  6. Look at stats. Warp capacitance is not increased (unless you have "simulation while docking" turned on).
  7. Leave station, wait until warp energy bar noticeably replenishes (with speccap-1 and shield-1 on reactor-1 it's not that slow) and re-dock.
  8. Look at stats. Warp cap increased.
Answer: indication in basecomputer.cpp is messed up. It tries to use functions instead of checking fields directly. But it uses current warp energy instead of max warp energy because the coder didn't find a proper function. See also: comments.

Re: SPEC Capacitors SVN 13248

Posted: Sat Nov 26, 2011 9:17 am
by pheonixstorm
Interesting.. wonder how long its been screwy then.

We shall send a trained monkey to create a patch and pray by the seat of our pants that it works.

Knowing more or less where the naughty code is should make this easier to fix. Good catch!

Re: SPEC Capacitors SVN 13248

Posted: Sat Nov 26, 2011 9:30 am
by Hicks
I found out by starting a new game. When you sell the capacitor on the llama, the value doesn't go down.

Re: SPEC Capacitors SVN 13248

Posted: Sat Nov 26, 2011 9:34 am
by pheonixstorm
Quirky. So it only goes down when you buy a new ship? That just seems... odd.

Re: SPEC Capacitors SVN 13248

Posted: Sat Dec 10, 2011 3:17 am
by Hicks
shouldn't there be a function in there to find max energy? how does it determine how much of the spec energy bar it needs to fill on the interface when you are flying?

Re: SPEC Capacitors SVN 13248

Posted: Mon Dec 12, 2011 7:28 pm
by TBeholder
Hicks wrote:shouldn't there be a function in there to find max energy? how does it determine how much of the spec energy bar it needs to fill on the interface when you are flying?
Maybe, but it's done simply by reading the field maxwarpenergy itself.
Warp gauge shows ->WarpEnergyData(), which if maxwarpenergy>0 is warpenergy/maxwarpenergy, otherwise if jump.energy > 0, warpenergy/jump.energy, and failed that, 0.