src/ai/api/ai_object.cpp
branchnoai
changeset 9486 a9b5f6b8667c
parent 9473 dcbcd1c4496d
child 9496 05ebee9884b3
--- a/src/ai/api/ai_object.cpp	Mon Mar 19 14:25:06 2007 +0000
+++ b/src/ai/api/ai_object.cpp	Mon Mar 19 14:30:56 2007 +0000
@@ -66,17 +66,21 @@
 	command_struct->costs = 0;
 }
 
-bool AIObject::DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc)
+bool AIObject::DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint procc)
 {
+	uint32 flags = 0;
 	PlayerID old_lp;
 	int32 res = 0;
 	const char* tmp_cmdtext;
 
+	flags |= DC_NO_WATER;
+	if (procc != CMD_LANDSCAPE_CLEAR) flags |= DC_AUTO;
+
 	/* The test already resets _cmd_text, so backup the pointer */
 	tmp_cmdtext = _cmd_text;
 
 	/* First, do a test-run to see if we can do this */
-	res = ::DoCommand(tile, p1, p2, flags & ~DC_EXEC, procc);
+	res = ::DoCommand(tile, p1, p2, flags, procc);
 	/* The command failed, so return */
 	if (::CmdFailed(res)) return false;
 
@@ -84,7 +88,7 @@
 	_cmd_text = tmp_cmdtext;
 
 	/* Check what the callback wants us to do */
-	if (AIObject::GetDoCommandMode() != NULL && !AIObject::GetDoCommandMode()(tile, p1, p2, flags, procc, res)) {
+	if (AIObject::GetDoCommandMode() != NULL && !AIObject::GetDoCommandMode()(tile, p1, p2, procc, res)) {
 		AIObject::IncreaseDoCommandCosts(res);
 		return true;
 	}