src/ai/trolly/build.cpp
branchcpp_gui
changeset 6308 646711c5feaa
parent 6087 b56c54f79335
child 7177 08330bb931a1
equal deleted inserted replaced
6307:f40e88cff863 6308:646711c5feaa
   121 			}
   121 			}
   122 			return cost;
   122 			return cost;
   123 		}
   123 		}
   124 		// Bridge code
   124 		// Bridge code
   125 		if ((AI_PATHFINDER_FLAG_BRIDGE & route_extra[part]) != 0) {
   125 		if ((AI_PATHFINDER_FLAG_BRIDGE & route_extra[part]) != 0) {
   126 			cost += AiNew_Build_Bridge(p, route[part], route[part-1], flag);
   126 			cost += AiNew_Build_Bridge(p, route[part], route[part - 1], flag);
   127 			PathFinderInfo->position++;
   127 			PathFinderInfo->position++;
   128 			// TODO: problems!
   128 			// TODO: problems!
   129 			if (CmdFailed(cost)) {
   129 			if (CmdFailed(cost)) {
   130 				DEBUG(ai, 0, "[BuildPath] bridge could not be built (0x%X, 0x%X)", route[part], route[part - 1]);
   130 				DEBUG(ai, 0, "[BuildPath] bridge could not be built (0x%X, 0x%X)", route[part], route[part - 1]);
   131 				return 0;
   131 				return 0;
   171 			}
   171 			}
   172 			return cost;
   172 			return cost;
   173 		}
   173 		}
   174 		// Bridge code
   174 		// Bridge code
   175 		if ((AI_PATHFINDER_FLAG_BRIDGE & route_extra[part]) != 0) {
   175 		if ((AI_PATHFINDER_FLAG_BRIDGE & route_extra[part]) != 0) {
   176 			cost += AiNew_Build_Bridge(p, route[part], route[part+1], flag);
   176 			cost += AiNew_Build_Bridge(p, route[part], route[part + 1], flag);
   177 			PathFinderInfo->position++;
   177 			PathFinderInfo->position++;
   178 			// TODO: problems!
   178 			// TODO: problems!
   179 			if (CmdFailed(cost)) {
   179 			if (CmdFailed(cost)) {
   180 				DEBUG(ai, 0, "[BuildPath] bridge could not be built (0x%X, 0x%X)", route[part], route[part + 1]);
   180 				DEBUG(ai, 0, "[BuildPath] bridge could not be built (0x%X, 0x%X)", route[part], route[part + 1]);
   181 				return 0;
   181 				return 0;