MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / StartGoldDrop

Function StartGoldDrop

Source/inv.cpp:953–973  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

951}
952
953void StartGoldDrop()
954{
955 CloseGoldWithdraw();
956
957 const int8_t invIndex = pcursinvitem;
958
959 const Player &myPlayer = *MyPlayer;
960
961 const int max = (invIndex <= INVITEM_INV_LAST)
962 ? myPlayer.InvList[invIndex - INVITEM_INV_FIRST]._ivalue
963 : myPlayer.SpdList[invIndex - INVITEM_BELT_FIRST]._ivalue;
964
965 if (talkflag)
966 control_reset_talk();
967
968 const Point start = GetPanelPosition(UiPanels::Inventory, { 67, 128 });
969 SDL_Rect rect = MakeSdlRect(start.x, start.y, 180, 20);
970 SDL_SetTextInputRect(&rect);
971
972 OpenGoldDrop(invIndex, max);
973}
974
975int CreateGoldItemInInventorySlot(Player &player, int slotIndex, int value)
976{

Callers 1

UseInvItemFunction · 0.85

Calls 6

CloseGoldWithdrawFunction · 0.85
control_reset_talkFunction · 0.85
GetPanelPositionFunction · 0.85
MakeSdlRectFunction · 0.85
SDL_SetTextInputRectFunction · 0.85
OpenGoldDropFunction · 0.85

Tested by

no test coverage detected