176 } |
176 } |
177 return 0xFFFFFFFF; |
177 return 0xFFFFFFFF; |
178 } |
178 } |
179 |
179 |
180 /* Distance of nearest industry of given type */ |
180 /* Distance of nearest industry of given type */ |
181 case 0x64: return GetClosestIndustry(tile, MapNewGRFIndustryType(parameter, indspec->grf_prop.grffile->grfid), industry); // Distance of nearest industry of given type |
181 case 0x64: return GetClosestIndustry(tile, MapNewGRFIndustryType(parameter, indspec->grf_prop.grffile->grfid), industry); |
182 /* Get town zone and Manhattan distance of closest town */ |
182 /* Get town zone and Manhattan distance of closest town */ |
183 case 0x65: return GetTownRadiusGroup(industry->town, tile) << 16 | min(DistanceManhattan(tile, industry->town->xy), 0xFFFF); |
183 case 0x65: return GetTownRadiusGroup(industry->town, tile) << 16 | min(DistanceManhattan(tile, industry->town->xy), 0xFFFF); |
184 /* Get square of Euclidian distance of closes town */ |
184 /* Get square of Euclidian distance of closes town */ |
185 case 0x66: return GetTownRadiusGroup(industry->town, tile) << 16 | min(DistanceSquare(tile, industry->town->xy), 0xFFFF); |
185 case 0x66: return GetTownRadiusGroup(industry->town, tile) << 16 | min(DistanceSquare(tile, industry->town->xy), 0xFFFF); |
186 |
186 |
187 /* Count of industry, distance of closest instance |
187 /* Count of industry, distance of closest instance |
188 * format is rr(reserved) cc(count) dddd(manhattan distance of closest sister) |
188 * format is rr(reserved) cc(count) dddd(manhattan distance of closest sister) |
189 * A lot more should be done, since it has to check for local id, grf id etc... |
189 * A lot more should be done, since it has to check for local id, grf id etc... |
190 * let's just say it is a beginning ;) */ |
190 * let's just say it is a beginning ;) */ |
191 case 0x67: return GetIndustryTypeCount(industry->type) << 16 | 0; |
191 case 0x67: return GetIndustryTypeCount(industry->type) << 16 | 0; |
|
192 case 0x68: break; |
192 |
193 |
193 /* Industry structure access*/ |
194 /* Industry structure access*/ |
194 case 0x80: return industry->xy; |
195 case 0x80: return industry->xy; |
195 case 0x81: return GB(industry->xy, 8, 8); |
196 case 0x81: return GB(industry->xy, 8, 8); |
196 /* Pointer to the town the industry is associated with */ |
197 /* Pointer to the town the industry is associated with */ |