src/command.cpp
branchgamebalance
changeset 9911 0b8b245a2391
parent 9910 0b2aebc8283e
child 9912 1ac8aac92385
--- a/src/command.cpp	Wed Jun 13 11:17:30 2007 +0000
+++ b/src/command.cpp	Wed Jun 13 11:45:14 2007 +0000
@@ -168,6 +168,14 @@
 DEF_COMMAND(CmdDepotSellAllVehicles);
 DEF_COMMAND(CmdDepotMassAutoReplace);
 
+DEF_COMMAND(CmdCreateGroup);
+DEF_COMMAND(CmdRenameGroup);
+DEF_COMMAND(CmdDeleteGroup);
+DEF_COMMAND(CmdAddVehicleGroup);
+DEF_COMMAND(CmdAddSharedVehicleGroup);
+DEF_COMMAND(CmdRemoveAllVehiclesGroup);
+DEF_COMMAND(CmdSetGroupReplaceProtection);
+
 /* The master command table */
 static const Command _command_proc_table[] = {
 	{CmdBuildRailroadTrack,                  0}, /*   0 */
@@ -313,6 +321,13 @@
 	{CmdMassStartStopVehicle,                0}, /* 117 */
 	{CmdDepotSellAllVehicles,                0}, /* 118 */
 	{CmdDepotMassAutoReplace,                0}, /* 119 */
+	{CmdCreateGroup,                         0}, /* 120 */
+	{CmdDeleteGroup,                         0}, /* 121 */
+	{CmdRenameGroup,                         0}, /* 122 */
+	{CmdAddVehicleGroup,                     0}, /* 123 */
+	{CmdAddSharedVehicleGroup,               0}, /* 124 */
+	{CmdRemoveAllVehiclesGroup,              0}, /* 125 */
+	{CmdSetGroupReplaceProtection,           0}, /* 126 */
 };
 
 /* This function range-checks a cmd, and checks if the cmd is not NULL */
@@ -339,7 +354,7 @@
 	CommandProc *proc;
 
 	/* Do not even think about executing out-of-bounds tile-commands */
-	if (tile >= MapSize()) {
+	if (tile >= MapSize() || IsTileType(tile, MP_VOID)) {
 		_cmd_text = NULL;
 		return CMD_ERROR;
 	}
@@ -417,7 +432,7 @@
 	int y = TileY(tile) * TILE_SIZE;
 
 	/* Do not even think about executing out-of-bounds tile-commands */
-	if (tile >= MapSize()) {
+	if (tile >= MapSize() || IsTileType(tile, MP_VOID)) {
 		_cmd_text = NULL;
 		return false;
 	}
@@ -456,13 +471,17 @@
 	 * restrictions which may cause the test run to fail (the previous
 	 * road fragments still stay there and the town won't let you
 	 * disconnect the road system), but the exec will succeed and this
-	 * fact will trigger an assertion failure. --pasky */
+	 * fact will trigger an assertion failure. --pasky
+	 * CMD_CLONE_VEHICLE: Both building new vehicles and refitting them can be
+	 * influenced by newgrf callbacks, which makes it impossible to accurately
+	 * estimate the cost of cloning a vehicle. */
 	notest =
 		(cmd & 0xFF) == CMD_CLEAR_AREA ||
 		(cmd & 0xFF) == CMD_CONVERT_RAIL ||
 		(cmd & 0xFF) == CMD_LEVEL_LAND ||
 		(cmd & 0xFF) == CMD_REMOVE_ROAD ||
-		(cmd & 0xFF) == CMD_REMOVE_LONG_ROAD;
+		(cmd & 0xFF) == CMD_REMOVE_LONG_ROAD ||
+		(cmd & 0xFF) == CMD_CLONE_VEHICLE;
 
 	_docommand_recursive = 1;