Changeset - r9011:6f2c64a96573
[Not reviewed]
master
0 2 0
glx - 16 years ago 2008-04-20 21:36:41
glx@openttd.org
(svn r12808) -Fix: enforce autorenew values range in command
-Fix: typo in english.txt
2 files changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/lang/english.txt
Show inline comments
 
@@ -1065,7 +1065,7 @@ STR_CONFIG_PATCHES_ORDER_REVIEW_ON      
 
STR_CONFIG_PATCHES_WARN_INCOME_LESS                             :{LTBLUE}Warn if a train's income is negative: {ORANGE}{STRING1}
 
STR_CONFIG_PATCHES_NEVER_EXPIRE_VEHICLES                        :{LTBLUE}Vehicles never expire: {ORANGE}{STRING1}
 
STR_CONFIG_PATCHES_AUTORENEW_VEHICLE                            :{LTBLUE}Autorenew vehicle when it gets old
 
STR_CONFIG_PATCHES_AUTORENEW_MONTHS                             :{LTBLUE}Autorenew when vehice is {ORANGE}{STRING1}{LTBLUE} months before/after max age
 
STR_CONFIG_PATCHES_AUTORENEW_MONTHS                             :{LTBLUE}Autorenew when vehicle is {ORANGE}{STRING1}{LTBLUE} months before/after max age
 
STR_CONFIG_PATCHES_AUTORENEW_MONEY                              :{LTBLUE}Autorenew minimum needed money for renew: {ORANGE}{STRING1}
 
STR_CONFIG_PATCHES_ERRMSG_DURATION                              :{LTBLUE}Duration of error message: {ORANGE}{STRING1}
 
STR_CONFIG_PATCHES_POPULATION_IN_LABEL                          :{LTBLUE}Show town population in the town name label: {ORANGE}{STRING1}
src/players.cpp
Show inline comments
 
@@ -670,6 +670,7 @@ CommandCost CmdSetAutoReplace(TileIndex 
 
			}
 
			break;
 
		case 1:
 
			if (Clamp((int16)p2, -12, 12) != (int16)p2) return CMD_ERROR;
 
			if (p->engine_renew_months == (int16)p2)
 
				return CMD_ERROR;
 

	
 
@@ -682,6 +683,7 @@ CommandCost CmdSetAutoReplace(TileIndex 
 
			}
 
			break;
 
		case 2:
 
			if (ClampU(p2, 0, 2000000) != p2) return CMD_ERROR;
 
			if (p->engine_renew_money == (uint32)p2)
 
				return CMD_ERROR;
 

	
 
@@ -730,6 +732,8 @@ CommandCost CmdSetAutoReplace(TileIndex 
 
		}
 

	
 
		case 4:
 
			if (Clamp((int16)GB(p1, 16, 16), -12, 12) != (int16)GB(p1, 16, 16)) return CMD_ERROR;
 
			if (ClampU(p2, 0, 2000000) != p2) return CMD_ERROR;
 
			if (flags & DC_EXEC) {
 
				p->engine_renew = HasBit(p1, 15);
 
				p->engine_renew_months = (int16)GB(p1, 16, 16);
0 comments (0 inline, 0 general)