this:
this is how it should be:
if ([eq_key isEqual:@"EQ_FUEL"])
{
// change order
credits -= ([self fuelCapacity] - [self fuel]) * price_per_unit;
fuel = [self fuelCapacity];
[self setGuiToEquipShipScreen
return YES;
}
in original code fuel is assigned before decreasing credits, making
fuel free of charge, I think.
Also implemented possibility for ships to have larger fuel
capacity then PLAYER_MAX_FUEL if someone is interested.
Change was simple. Added new var fuel_capacity in PlayerEntity
second version of dialFuel (dialFuelCapacity),
which is called from head up display in order to display ratio
fuel/capacity instead of fuel/PLAYER_MAX_FUEL.
One is is used for circle in galactic map and other for head up
display. Changed to refer to fuelCapacity instead of
PLAYER_MAX_FUEL where appropriate. Also added dictionary
key 'fuel_capacity' with which this variable is initialized.
Defaults to PLAYER_MAX_FUEL if not present for player ship
and to 'fuel' from dictionary for ai ships.
In this way ships cannot jump further then 7 lt years
but can have larger fuel capacity. This was inspired by:
"
// FIXME: shipdata.plist can allow greater fuel quantities (without extending hyperspace range). Need some consistency here.
"
Greets, to all.
Branimir.