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.51 by root, Mon Apr 23 18:09:57 2007 UTC vs.
Revision 1.54 by root, Fri Apr 27 20:06:37 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 | logBacktrace, "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 | logBacktrace, "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
553fork_abort (const char *msg) 553fork_abort (const char *msg)
554{ 554{
555 if (!fork ()) 555 if (!fork ())
556 { 556 {
557 signal (SIGABRT, SIG_DFL); 557 signal (SIGABRT, SIG_DFL);
558 // try to put corefiles into a subdirectory, if existing, to allow
559 // an administrator to reduce the I/O load.
560 chdir ("cores");
558 abort (); 561 abort ();
559 } 562 }
560 563
561 LOG (llevError, "fork abort: %s\n", msg); 564 LOG (llevError, "fork abort: %s\n", msg);
562} 565}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines