| 1260 | } |
| 1261 | |
| 1262 | bool UseSpecialItem(ItemInfo* laraItem) |
| 1263 | { |
| 1264 | auto* lara = GetLaraInfo(laraItem); |
| 1265 | |
| 1266 | int flag = 0; |
| 1267 | int itemIDToUse = g_Gui.GetInventoryItemChosen(); |
| 1268 | |
| 1269 | if (itemIDToUse != NO_VALUE && |
| 1270 | laraItem->Animation.AnimNumber == LA_STAND_IDLE && |
| 1271 | lara->Control.HandStatus == HandStatus::Free) |
| 1272 | { |
| 1273 | if (itemIDToUse >= ID_WATERSKIN1_EMPTY && itemIDToUse <= ID_WATERSKIN2_5) |
| 1274 | { |
| 1275 | laraItem->ItemFlags[2] = ID_LARA_WATER_MESH; |
| 1276 | flag = 1; |
| 1277 | } |
| 1278 | else if (itemIDToUse == ID_CLOCKWORK_BEETLE) |
| 1279 | { |
| 1280 | flag = 4; |
| 1281 | SetAnimation(laraItem, LA_MECHANICAL_BEETLE_USE); |
| 1282 | UseClockworkBeetle(true); |
| 1283 | } |
| 1284 | |
| 1285 | if (flag == 1) |
| 1286 | { |
| 1287 | if (itemIDToUse != ID_WATERSKIN1_3 && itemIDToUse != ID_WATERSKIN2_5 && (lara->Context.WaterSurfaceDist < -SHALLOW_WATER_DEPTH)) |
| 1288 | { |
| 1289 | if (itemIDToUse < ID_WATERSKIN1_3) |
| 1290 | lara->Inventory.SmallWaterskin = 4; |
| 1291 | else |
| 1292 | lara->Inventory.BigWaterskin = 6; |
| 1293 | |
| 1294 | flag = 1; |
| 1295 | } |
| 1296 | else if (itemIDToUse != ID_WATERSKIN1_EMPTY && itemIDToUse != ID_WATERSKIN2_EMPTY) |
| 1297 | { |
| 1298 | if (itemIDToUse <= ID_WATERSKIN1_3) |
| 1299 | { |
| 1300 | laraItem->ItemFlags[3] = lara->Inventory.SmallWaterskin - 1; |
| 1301 | lara->Inventory.SmallWaterskin = 1; |
| 1302 | } |
| 1303 | else |
| 1304 | { |
| 1305 | laraItem->ItemFlags[3] = lara->Inventory.BigWaterskin - 1; |
| 1306 | lara->Inventory.BigWaterskin = 1; |
| 1307 | } |
| 1308 | |
| 1309 | flag = 2; |
| 1310 | } |
| 1311 | else |
| 1312 | return false; |
| 1313 | } |
| 1314 | |
| 1315 | if (flag) |
| 1316 | { |
| 1317 | if (flag == 1) |
| 1318 | SetAnimation(laraItem, LA_WATERSKIN_FILL); |
| 1319 | else if (flag == 2) |
no test coverage detected