version 1.3 | version 1.4 | |||
---|---|---|---|---|
|
| |||
if (fl->total_chance > 0) { | if (fl->total_chance > 0) { | |||
r=RANDOM()%fl->total_chance; | r=RANDOM()%fl->total_chance; | |||
printf(" r = %d\n", r); | ||||
for (rp=fl->items;rp;rp=rp->next) { | for (rp=fl->items;rp;rp=rp->next) { | |||
r -= rp->chance; | r -= rp->chance; | |||
if (r<0) break; | if (r<0) break; |
Legend:
|