ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/utils.C
(Generate patch)

Comparing deliantra/server/common/utils.C (file contents):
Revision 1.52 by root, Fri Apr 27 14:41:37 2007 UTC vs.
Revision 1.53 by root, Fri Apr 27 19:53:57 2007 UTC

97{ 97{
98 int base = r_max - r_min > 1 ? 20 : 50; /* d2 and d3 are corner cases */ 98 int base = r_max - r_min > 1 ? 20 : 50; /* d2 and d3 are corner cases */
99 99
100 if (r_max < 1 || r_max < r_min) 100 if (r_max < 1 || r_max < r_min)
101 { 101 {
102 LOG (llevError, "Calling random_roll with min=%d max=%d\n", r_min, r_max); 102 LOG (llevError | log_Backtrace, "Calling random_roll with min=%d max=%d\n", r_min, r_max);
103 return r_min; 103 return r_min;
104 } 104 }
105 105
106 if (op->type == PLAYER) 106 if (op->type == PLAYER)
107 { 107 {
130 diff = max - min + 1; 130 diff = max - min + 1;
131 ((diff > 2) ? (base = 20) : (base = 50)); /* d2 and d3 are corner cases */ 131 ((diff > 2) ? (base = 20) : (base = 50)); /* d2 and d3 are corner cases */
132 132
133 if (max < 1 || diff < 1) 133 if (max < 1 || diff < 1)
134 { 134 {
135 LOG (llevError, "Calling random_roll with min=%" PRId64 " max=%" PRId64 "\n", min, max); 135 LOG (llevError | log_Backtrace, "Calling random_roll64 with min=%" PRId64 " max=%" PRId64 "\n", min, max);
136 return (min); /* avoids a float exception */ 136 return (min); /* avoids a float exception */
137 } 137 }
138 138
139 /* 139 /*
140 * Make a call to get two 32 bit unsigned random numbers, and just to 140 * Make a call to get two 32 bit unsigned random numbers, and just to

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines