Skip to content

Commit

Permalink
(svn r1495) -Fix: Loan does not count against the company value
Browse files Browse the repository at this point in the history
-Feature: New companies receive a 5-year protection period
  • Loading branch information
celestar committed Jan 13, 2005
1 parent 131f4c5 commit 0074496
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
13 changes: 9 additions & 4 deletions economy.c
Expand Up @@ -105,10 +105,9 @@ int64 CalculateCompanyValue(Player *p) {
}
}

if (p->player_money > 0)
value += p->money64; // add real money value

return value;
value += p->money64 - p->current_loan; // add real money value

return max(value, 1);
}

// if update is set to true, the economy is updated with this score
Expand Down Expand Up @@ -1533,6 +1532,12 @@ int32 CmdBuyShareInCompany(int x, int y, uint32 flags, uint32 p1, uint32 p2)

SET_EXPENSES_TYPE(EXPENSES_OTHER);
p = DEREF_PLAYER(p1);


if (_cur_year - p->inaugurated_year < 6) {
_error_message = STR_7080_PROTECTED;
return CMD_ERROR;
}

/* Check if buying shares is allowed (protection against modified clients */
if (!_patches.allow_shares)
Expand Down
1 change: 1 addition & 0 deletions lang/english.txt
Expand Up @@ -2090,6 +2090,7 @@ STR_707C_CAN_T_SELL_25_SHARE_IN :{WHITE}Can't sell 25% share in this company
STR_707D_OWNED_BY :{WHITE}({COMMA16}% owned by {STRING})
STR_707E_OWNED_BY_OWNED_BY :{WHITE}({COMMA16}% owned by {STRING}{} {COMMA16}% owned by {STRING})
STR_707F_HAS_BEEN_TAKEN_OVER_BY :{BLACK}{BIGFONT}{STRING} has been taken over by {STRING}!
STR_7080_PROTECTED :{WHITE}This company does not trade shares yet...

##id 0x8000
STR_8000_KIRBY_PAUL_TANK_STEAM :Kirby Paul Tank (Steam)
Expand Down

0 comments on commit 0074496

Please sign in to comment.