… | |
… | |
1030 | * |
1030 | * |
1031 | * 0.94.2 - you probably shouldn't need to change any of the rand stuff |
1031 | * 0.94.2 - you probably shouldn't need to change any of the rand stuff |
1032 | * here. |
1032 | * here. |
1033 | */ |
1033 | */ |
1034 | |
1034 | |
1035 | #ifdef HAVE_SRANDOM |
|
|
1036 | # define RANDOM() random() |
1035 | #define RANDOM() random() |
1037 | # define SRANDOM(xyz) srandom(xyz) |
1036 | #define SRANDOM(xyz) srandom(xyz) |
1038 | #else |
|
|
1039 | # ifdef HAVE_SRAND48 |
|
|
1040 | # define RANDOM() lrand48() |
|
|
1041 | # define SRANDOM(xyz) srand48(xyz) |
|
|
1042 | # else |
|
|
1043 | # ifdef HAVE_SRAND |
|
|
1044 | # define RANDOM() rand() |
|
|
1045 | # define SRANDOM(xyz) srand(xyz) |
|
|
1046 | # else |
|
|
1047 | # error "Could not find a usable random routine" |
|
|
1048 | # endif |
|
|
1049 | # endif |
|
|
1050 | #endif |
|
|
1051 | |
1037 | |
1052 | /* Returns the weight of the given object. Note: it does not take the number of |
1038 | /* Returns the weight of the given object. Note: it does not take the number of |
1053 | * items (nrof) into account. |
1039 | * items (nrof) into account. |
1054 | */ |
1040 | */ |
1055 | #define WEIGHT(op) (op->nrof?op->weight:op->weight+op->carrying) |
1041 | #define WEIGHT(op) (op->nrof?op->weight:op->weight+op->carrying) |