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

Function SortSmith

Source/items.cpp:3349–3370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3347}
3348
3349void SortSmith()
3350{
3351 int j, k;
3352 BOOL sorted;
3353
3354 j = 0;
3355 while (smithitem[j + 1]._itype != ITYPE_NONE) {
3356 j++;
3357 }
3358
3359 sorted = FALSE;
3360 while (j > 0 && !sorted) {
3361 sorted = TRUE;
3362 for (k = 0; k < j; k++) {
3363 if (smithitem[k].IDidx > smithitem[k + 1].IDidx) {
3364 BubbleSwapItem(&smithitem[k], &smithitem[k + 1]);
3365 sorted = FALSE;
3366 }
3367 }
3368 j--;
3369 }
3370}
3371
3372void SpawnSmith(int lvl)
3373{

Callers 1

SpawnSmithFunction · 0.85

Calls 1

BubbleSwapItemFunction · 0.85

Tested by

no test coverage detected