moves to the next/prev item in the inventory list (forward==TRUE means forward, forward==FALSE means go backwards)
| 1330 | |
| 1331 | // moves to the next/prev item in the inventory list (forward==TRUE means forward, forward==FALSE means go backwards) |
| 1332 | void InventorySwitch(bool forward) { |
| 1333 | int ctype, cid; |
| 1334 | |
| 1335 | Players[Player_num].inventory.GetPosTypeID(ctype, cid); |
| 1336 | |
| 1337 | if (ctype != 0) { |
| 1338 | if (forward) { |
| 1339 | Players[Player_num].inventory.NextPos(); |
| 1340 | } else { |
| 1341 | Players[Player_num].inventory.PrevPos(); |
| 1342 | } |
| 1343 | |
| 1344 | int ntype, nid; |
| 1345 | Players[Player_num].inventory.GetPosTypeID(ntype, nid); |
| 1346 | |
| 1347 | if (ntype != ctype || nid != cid) { |
| 1348 | // AddHUDMessage(TXT_WPNSELECT, Players[Player_num].inventory.GetPosName()); |
| 1349 | Sound_system.Play2dSound(SOUND_CHANGE_INVENTORY); |
| 1350 | |
| 1351 | ain_hear hear; |
| 1352 | hear.f_directly_player = true; |
| 1353 | hear.hostile_level = 0.0f; |
| 1354 | hear.curiosity_level = 0.3f; |
| 1355 | hear.max_dist = AI_SOUND_SHORT_DIST; |
| 1356 | AINotify(&Objects[Players[Player_num].objnum], AIN_HEAR_NOISE, (void *)&hear); |
| 1357 | } |
| 1358 | } |
| 1359 | } |
| 1360 | |
| 1361 | // moves to the next/prev item in the counter measures list (forward==TRUE means forward, forward==FALSE means go |
| 1362 | // backwards) |
no test coverage detected