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

Function SortWitch

Source/items.cpp:3528–3549  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3526}
3527
3528void SortWitch()
3529{
3530 int j, k;
3531 BOOL sorted;
3532
3533 j = 3;
3534 while (witchitem[j + 1]._itype != ITYPE_NONE) {
3535 j++;
3536 }
3537
3538 sorted = FALSE;
3539 while (j > 3 && !sorted) {
3540 sorted = TRUE;
3541 for (k = 3; k < j; k++) {
3542 if (witchitem[k].IDidx > witchitem[k + 1].IDidx) {
3543 BubbleSwapItem(&witchitem[k], &witchitem[k + 1]);
3544 sorted = FALSE;
3545 }
3546 }
3547 j--;
3548 }
3549}
3550
3551void WitchBookLevel(int ii)
3552{

Callers 1

SpawnWitchFunction · 0.85

Calls 1

BubbleSwapItemFunction · 0.85

Tested by

no test coverage detected