MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / UseCountermeasure

Function UseCountermeasure

Descent3/Inventory.cpp:1501–1514  ·  view source on GitHub ↗

use the currently selected countermeasure

Source from the content-addressed store, hash-verified

1499
1500// use the currently selected countermeasure
1501bool UseCountermeasure() {
1502 int type, id;
1503
1504 Players[Player_num].counter_measures.GetPosTypeID(type, id);
1505 if (!type && !id)
1506 return false;
1507
1508 if (Players[Player_num].counter_measures.UsePos(&Objects[Players[Player_num].objnum])) {
1509 if (Game_mode & GM_MULTI && (Netgame.local_role == LR_SERVER)) {
1510 MultiSendInventoryRemoveItem(Player_num, type, id);
1511 }
1512 }
1513 return true;
1514}
1515
1516// Checks for an object in any of the players inventorys and removes it
1517void InventoryRemoveObject(int objhandle) {

Callers 2

DoKeyboardMiscFunction · 0.85
DoControllerMiscFunction · 0.85

Calls 3

GetPosTypeIDMethod · 0.80
UsePosMethod · 0.80

Tested by

no test coverage detected