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

Function UseInventoryItem

Descent3/Inventory.cpp:1485–1498  ·  view source on GitHub ↗

use the currently selected inventory item

Source from the content-addressed store, hash-verified

1483
1484// use the currently selected inventory item
1485bool UseInventoryItem() {
1486 int type, id;
1487
1488 Players[Player_num].inventory.GetPosTypeID(type, id);
1489 if (!type && !id)
1490 return false;
1491
1492 if (Players[Player_num].inventory.UsePos(&Objects[Players[Player_num].objnum])) {
1493 if (Game_mode & GM_MULTI && (Netgame.local_role == LR_SERVER)) {
1494 MultiSendInventoryRemoveItem(Player_num, type, id);
1495 }
1496 }
1497 return true;
1498}
1499
1500// use the currently selected countermeasure
1501bool UseCountermeasure() {

Callers 2

DoKeyboardMiscFunction · 0.85
DoControllerMiscFunction · 0.85

Calls 3

GetPosTypeIDMethod · 0.80
UsePosMethod · 0.80

Tested by

no test coverage detected