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

Function RndSmithItem

Source/items.cpp:3320–3338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3318}
3319
3320int RndSmithItem(int lvl)
3321{
3322 int i, ri;
3323 int ril[512];
3324
3325 ri = 0;
3326 for (i = 1; AllItemsList[i].iLoc != ILOC_INVALID; i++) {
3327 if (AllItemsList[i].iRnd && SmithItemOk(i) && lvl >= AllItemsList[i].iMinMLvl) {
3328 ril[ri] = i;
3329 ri++;
3330 if (AllItemsList[i].iRnd == 2) {
3331 ril[ri] = i;
3332 ri++;
3333 }
3334 }
3335 }
3336
3337 return ril[random_(50, ri)] + 1;
3338}
3339
3340void BubbleSwapItem(ItemStruct *a, ItemStruct *b)
3341{

Callers 2

SpawnSmithFunction · 0.85
RecreateSmithItemFunction · 0.85

Calls 2

SmithItemOkFunction · 0.85
random_Function · 0.85

Tested by

no test coverage detected