… | |
… | |
425 | * flags[2] is 64 to 95 |
425 | * flags[2] is 64 to 95 |
426 | * flags[3] is 96 to 127 |
426 | * flags[3] is 96 to 127 |
427 | */ |
427 | */ |
428 | |
428 | |
429 | /* Basic routines to do above */ |
429 | /* Basic routines to do above */ |
430 | #define SET_FLAG(xyz, p) \ |
430 | #define SET_FLAG(obj, flag) (obj)->flags[flag] = 1 |
431 | ((xyz)->flags[p/32] |= (1U << (p % 32))) |
431 | #define CLEAR_FLAG(obj, flag) (obj)->flags[flag] = 0 |
432 | #define CLEAR_FLAG(xyz, p) \ |
432 | #define QUERY_FLAG(obj, flag) (obj)->flags[flag] |
433 | ((xyz)->flags[p/32] &= ~(1U << (p % 32))) |
|
|
434 | #define QUERY_FLAG(xyz, p) \ |
|
|
435 | ((xyz)->flags[p/32] & (1U << (p % 32))) |
|
|
436 | #define COMPARE_FLAGS(p,q) \ |
|
|
437 | ( \ |
|
|
438 | ((p)->flags[0] == (q)->flags[0]) && \ |
|
|
439 | ((p)->flags[1] == (q)->flags[1]) && \ |
|
|
440 | ((p)->flags[2] == (q)->flags[2]) && \ |
|
|
441 | ((p)->flags[3] == (q)->flags[3]) \ |
|
|
442 | ) |
|
|
443 | |
433 | |
444 | /* convenience macros to determine what kind of things we are dealing with */ |
434 | /* convenience macros to determine what kind of things we are dealing with */ |
445 | |
435 | |
446 | #define IS_WEAPON(op) \ |
436 | #define IS_WEAPON(op) \ |
447 | (op->type == ARROW || op->type == BOW || op->type == WEAPON) |
437 | (op->type == ARROW || op->type == BOW || op->type == WEAPON) |