changeset 15041:78fafe2cf7c1 draft

(svn r19658) -Fix: One could turn transport companies into credit banks.
author frosch <frosch@openttd.org>
date Sat, 17 Apr 2010 14:57:49 +0000
parents 3314e49704e7
children 93b87430004c
files src/landscape.cpp src/misc_cmd.cpp
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/landscape.cpp
+++ b/src/landscape.cpp
@@ -604,8 +604,8 @@
 
 /** Clear a big piece of landscape
  * @param tile end tile of area dragging
+ * @param flags of operation to conduct
  * @param p1 start tile of area dragging
- * @param flags of operation to conduct
  * @param p2 unused
  * @param text unused
  * @return the cost of this operation or an error
--- a/src/misc_cmd.cpp
+++ b/src/misc_cmd.cpp
@@ -97,7 +97,7 @@
 			loan -= loan % LOAN_INTERVAL;
 			break;
 		case 2: // Repay the given amount of loan
-			if (p1 % LOAN_INTERVAL != 0 || (int32)p1 < LOAN_INTERVAL) return CMD_ERROR; // Invalid amount to loan
+			if (p1 % LOAN_INTERVAL != 0 || (int32)p1 < LOAN_INTERVAL || p1 > c->current_loan) return CMD_ERROR; // Invalid amount to loan
 			loan = p1;
 			break;
 	}