Skip to content

Commit

Permalink
some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
qndel authored and AJenbo committed Dec 6, 2020
1 parent 0c38d24 commit e73e1fc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 22 deletions.
43 changes: 22 additions & 21 deletions Source/items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2643,7 +2643,7 @@ int RndItem(int m)
ril[ri] = i;
ri++;
}
if (AllItemsList[i].iRnd && monster[m].mLevel >= AllItemsList[i].iMinMLvl
if (AllItemsList[i].iRnd != IDROP_NEVER && monster[m].mLevel >= AllItemsList[i].iMinMLvl
#ifdef HELLFIRE
&& ri < 512
#endif
Expand Down Expand Up @@ -2676,7 +2676,7 @@ int RndUItem(int m)
ri = 0;
for (i = 0; AllItemsList[i].iLoc != ILOC_INVALID; i++) {
okflag = TRUE;
if (!AllItemsList[i].iRnd)
if (AllItemsList[i].iRnd == IDROP_NEVER)
okflag = FALSE;
if (m != -1) {
if (monster[m].mLevel < AllItemsList[i].iMinMLvl)
Expand Down Expand Up @@ -2728,9 +2728,9 @@ int RndAllItems()
ri = 0;
for (i = 0; AllItemsList[i].iLoc != ILOC_INVALID; i++) {
#ifdef HELLFIRE
if (AllItemsList[i].iRnd && 2 * curlv >= AllItemsList[i].iMinMLvl && ri < 512) {
if (AllItemsList[i].iRnd != IDROP_NEVER && 2 * curlv >= AllItemsList[i].iMinMLvl && ri < 512) {
#else
if (AllItemsList[i].iRnd && 2 * currlevel >= AllItemsList[i].iMinMLvl) {
if (AllItemsList[i].iRnd != IDROP_NEVER && 2 * currlevel >= AllItemsList[i].iMinMLvl) {
#endif
ril[ri] = i;
ri++;
Expand All @@ -2757,7 +2757,7 @@ int RndTypeItems(int itype, int imid)
ri = 0;
for (i = 0; AllItemsList[i].iLoc != ILOC_INVALID; i++) {
okflag = TRUE;
if (!AllItemsList[i].iRnd)
if (AllItemsList[i].iRnd == IDROP_NEVER)
okflag = FALSE;
#ifdef HELLFIRE
if (lvl << 1 < AllItemsList[i].iMinMLvl)
Expand Down Expand Up @@ -4820,18 +4820,18 @@ int RndSmithItem(int lvl)

ri = 0;
for (i = 1; AllItemsList[i].iLoc != ILOC_INVALID; i++) {
if (AllItemsList[i].iRnd != IDROP_NEVER && SmithItemOk(i) && lvl >= AllItemsList[i].iMinMLvl
#ifdef HELLFIRE
if (AllItemsList[i].iRnd && SmithItemOk(i) && lvl >= AllItemsList[i].iMinMLvl && ri < 512) {
#else
if (AllItemsList[i].iRnd && SmithItemOk(i) && lvl >= AllItemsList[i].iMinMLvl) {
&& ri < 512
#endif
) {
ril[ri] = i;
ri++;
if (AllItemsList[i].iRnd == IDROP_DOUBLE
#ifdef HELLFIRE
if (AllItemsList[i].iRnd == IDROP_DOUBLE && ri < 512) {
#else
if (AllItemsList[i].iRnd == IDROP_DOUBLE) {
&& ri < 512
#endif
) {
ril[ri] = i;
ri++;
}
Expand Down Expand Up @@ -4944,7 +4944,7 @@ int RndPremiumItem(int minlvl, int maxlvl)

ri = 0;
for (i = 1; AllItemsList[i].iLoc != ILOC_INVALID; i++) {
if (AllItemsList[i].iRnd) {
if (AllItemsList[i].iRnd != IDROP_NEVER) {
if (PremiumItemOk(i)) {
#ifdef HELLFIRE
if (AllItemsList[i].iMinMLvl >= minlvl && AllItemsList[i].iMinMLvl <= maxlvl && ri < 512) {
Expand Down Expand Up @@ -5093,11 +5093,12 @@ int RndWitchItem(int lvl)

ri = 0;
for (i = 1; AllItemsList[i].iLoc != ILOC_INVALID; i++) {
if (AllItemsList[i].iRnd != IDROP_NEVER && WitchItemOk(i) && lvl >= AllItemsList[i].iMinMLvl
#ifdef HELLFIRE
if (AllItemsList[i].iRnd && WitchItemOk(i) && lvl >= AllItemsList[i].iMinMLvl && ri < 512) {
#else
if (AllItemsList[i].iRnd && WitchItemOk(i) && lvl >= AllItemsList[i].iMinMLvl) {
&& ri < 512
#endif
) {

ril[ri] = i;
ri++;
}
Expand Down Expand Up @@ -5204,11 +5205,11 @@ int RndBoyItem(int lvl)

ri = 0;
for (i = 1; AllItemsList[i].iLoc != ILOC_INVALID; i++) {
if (AllItemsList[i].iRnd != IDROP_NEVER && PremiumItemOk(i) && lvl >= AllItemsList[i].iMinMLvl
#ifdef HELLFIRE
if (AllItemsList[i].iRnd && PremiumItemOk(i) && lvl >= AllItemsList[i].iMinMLvl && ri < 512) {
#else
if (AllItemsList[i].iRnd && PremiumItemOk(i) && lvl >= AllItemsList[i].iMinMLvl) {
&& ri < 512
#endif
) {
ril[ri] = i;
ri++;
}
Expand Down Expand Up @@ -5321,11 +5322,11 @@ int RndHealerItem(int lvl)

ri = 0;
for (i = 1; AllItemsList[i].iLoc != ILOC_INVALID; i++) {
if (AllItemsList[i].iRnd != IDROP_NEVER && HealerItemOk(i) && lvl >= AllItemsList[i].iMinMLvl
#ifdef HELLFIRE
if (AllItemsList[i].iRnd && HealerItemOk(i) && lvl >= AllItemsList[i].iMinMLvl && ri < 512) {
#else
if (AllItemsList[i].iRnd && HealerItemOk(i) && lvl >= AllItemsList[i].iMinMLvl) {
&& ri < 512
#endif
) {
ril[ri] = i;
ri++;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/missiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5654,7 +5654,7 @@ void MI_Bonespirit(int i)
ChangeLight(missile[i]._mlid, cx, cy, 8);
}
if (missile[i]._mirange == 0) {
SetMissDir(i, DIR_OMNI);
SetMissDir(i, 8);
missile[i]._mirange = 7;
}
PutMissile(i);
Expand Down

0 comments on commit e73e1fc

Please sign in to comment.