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

Function RndWitchItem

Source/items.cpp:3512–3526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3510}
3511
3512int RndWitchItem(int lvl)
3513{
3514 int i, ri;
3515 int ril[512];
3516
3517 ri = 0;
3518 for (i = 1; AllItemsList[i].iLoc != ILOC_INVALID; i++) {
3519 if (AllItemsList[i].iRnd && WitchItemOk(i) && lvl >= AllItemsList[i].iMinMLvl) {
3520 ril[ri] = i;
3521 ri++;
3522 }
3523 }
3524
3525 return ril[random_(51, ri)] + 1;
3526}
3527
3528void SortWitch()
3529{

Callers 2

SpawnWitchFunction · 0.85
RecreateWitchItemFunction · 0.85

Calls 2

WitchItemOkFunction · 0.85
random_Function · 0.85

Tested by

no test coverage detected