| 664 | } |
| 665 | |
| 666 | void clampentityattributes(persistent_entity &e) |
| 667 | { |
| 668 | if(e.type < MAXENTTYPES) |
| 669 | { |
| 670 | int c; |
| 671 | #define CLAMPATTR(x) \ |
| 672 | c = entwraparound[e.type][x - 1]; \ |
| 673 | if(c > 0) e.attr##x = (e.attr##x % c + c) % c; /* fold value into range 0..c */ \ |
| 674 | else if(c < 0) e.attr##x = e.attr##x % (-c) /* fold value into range -c..c */ |
| 675 | CLAMPATTR(1); |
| 676 | CLAMPATTR(2); |
| 677 | CLAMPATTR(3); |
| 678 | CLAMPATTR(4); |
| 679 | CLAMPATTR(5); |
| 680 | CLAMPATTR(6); |
| 681 | CLAMPATTR(7); |
| 682 | } |
| 683 | } |
| 684 | |
| 685 | const char *formatentityattributes(const persistent_entity &e, bool withcomma) |
| 686 | { |
no outgoing calls
no test coverage detected