MCPcopy Create free account
hub / github.com/diasurgical/devilution / SmithRepairItem

Function SmithRepairItem

Source/stores.cpp:2081–2103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2079}
2080
2081void SmithRepairItem()
2082{
2083 int i, idx;
2084
2085 TakePlrsMoney(plr[myplr].HoldItem._iIvalue);
2086
2087 idx = stextvhold + ((stextlhold - stextup) >> 2);
2088 storehold[idx]._iDurability = storehold[idx]._iMaxDur;
2089
2090 i = storehidx[idx];
2091 if (i < 0) {
2092 if (i == -1)
2093 plr[myplr].InvBody[INVLOC_HEAD]._iDurability = plr[myplr].InvBody[INVLOC_HEAD]._iMaxDur;
2094 if (i == -2)
2095 plr[myplr].InvBody[INVLOC_CHEST]._iDurability = plr[myplr].InvBody[INVLOC_CHEST]._iMaxDur;
2096 if (i == -3)
2097 plr[myplr].InvBody[INVLOC_HAND_LEFT]._iDurability = plr[myplr].InvBody[INVLOC_HAND_LEFT]._iMaxDur;
2098 if (i == -4)
2099 plr[myplr].InvBody[INVLOC_HAND_RIGHT]._iDurability = plr[myplr].InvBody[INVLOC_HAND_RIGHT]._iMaxDur;
2100 } else {
2101 plr[myplr].InvList[i]._iDurability = plr[myplr].InvList[i]._iMaxDur;
2102 }
2103}
2104
2105void S_SRepairEnter()
2106{

Callers 1

S_ConfirmEnterFunction · 0.85

Calls 1

TakePlrsMoneyFunction · 0.85

Tested by

no test coverage detected