| 1228 | |
| 1229 | |
| 1230 | int GetEngineProperty(EngineID engine, PropertyID property, int orig_value, const Vehicle *v, bool is_signed) |
| 1231 | { |
| 1232 | uint16_t callback = GetVehicleCallback(CBID_VEHICLE_MODIFY_PROPERTY, property, 0, engine, v); |
| 1233 | if (callback != CALLBACK_FAILED) { |
| 1234 | if (is_signed) { |
| 1235 | /* Sign extend 15 bit integer */ |
| 1236 | return static_cast<int16_t>(callback << 1) / 2; |
| 1237 | } else { |
| 1238 | return callback; |
| 1239 | } |
| 1240 | } |
| 1241 | |
| 1242 | return orig_value; |
| 1243 | } |
| 1244 | |
| 1245 | /** |
| 1246 | * Test for vehicle build probability type. |
no test coverage detected