moves to the next/prev item in the counter measures list (forward==TRUE means forward, forward==FALSE means go backwards)
| 1361 | // moves to the next/prev item in the counter measures list (forward==TRUE means forward, forward==FALSE means go |
| 1362 | // backwards) |
| 1363 | void CounterMeasuresSwitch(bool forward) { |
| 1364 | int ctype, cid; |
| 1365 | |
| 1366 | Players[Player_num].counter_measures.GetPosTypeID(ctype, cid); |
| 1367 | |
| 1368 | if (ctype != 0) { |
| 1369 | if (forward) { |
| 1370 | Players[Player_num].counter_measures.NextPos(); |
| 1371 | } else { |
| 1372 | Players[Player_num].counter_measures.PrevPos(); |
| 1373 | } |
| 1374 | |
| 1375 | int ntype, nid; |
| 1376 | Players[Player_num].counter_measures.GetPosTypeID(ntype, nid); |
| 1377 | |
| 1378 | if (ntype != ctype || nid != cid) { |
| 1379 | AddHUDMessage(TXT_WPNSELECT, Players[Player_num].counter_measures.GetPosName()); |
| 1380 | Sound_system.Play2dSound(SOUND_CHANGE_COUNTERMEASURE); |
| 1381 | |
| 1382 | ain_hear hear; |
| 1383 | hear.f_directly_player = true; |
| 1384 | hear.hostile_level = 0.0f; |
| 1385 | hear.curiosity_level = 0.3f; |
| 1386 | hear.max_dist = AI_SOUND_SHORT_DIST; |
| 1387 | AINotify(&Objects[Players[Player_num].objnum], AIN_HEAR_NOISE, (void *)&hear); |
| 1388 | } |
| 1389 | } |
| 1390 | } |
| 1391 | |
| 1392 | // repositions the pos so its in the correct spot |
| 1393 | void Inventory::ValidatePos(bool forward) { |
no test coverage detected