Skip to content

Commit

Permalink
Fixed #2, Loan interval is to small in slow pace modes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stepan Dyatkovskiy (kaomoneus) committed Nov 22, 2021
1 parent 3d5e043 commit d77c3bc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/economy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@

#include "table/strings.h"
#include "table/pricebase.h"
#include "economy_type.h"

#include "safeguards.h"

Expand Down Expand Up @@ -100,6 +101,11 @@ Prices _price;
Money _additional_cash_required;
static PriceMultipliers _price_base_multiplier;

int GetLoanInterval() {
return VANILLA_LOAN_INTERVAL * GetPaceFactor();
}


/**
* Calculate the value of the company. That is the value of all
* assets (vehicles, stations, etc) and money minus the loan,
Expand Down
10 changes: 9 additions & 1 deletion src/economy_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,15 @@ struct PriceBaseSpec {
};

/** The "steps" in loan size, in British Pounds! */
static const int LOAN_INTERVAL = 10000;
#define LOAN_INTERVAL GetLoanInterval()
static const int VANILLA_LOAN_INTERVAL = 10000;

/**
* Loan interval per given pace factor settings
* @return Loan interval per given pace factor settings
*/
int GetLoanInterval();

/** The size of loan for a new company, in British Pounds! */
static const int64 INITIAL_LOAN = 100000;

Expand Down
2 changes: 1 addition & 1 deletion src/misc_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "safeguards.h"

/* Make sure we can discard lower 2 bits of 64bit amount when passing it to Cmd[In|De]creaseLoan() */
static_assert((LOAN_INTERVAL & 3) == 0);
static_assert((VANILLA_LOAN_INTERVAL & 3) == 0);

/**
* Increase the loan of your company.
Expand Down

0 comments on commit d77c3bc

Please sign in to comment.