… | |
… | |
660 | |
660 | |
661 | if (op->more) |
661 | if (op->more) |
662 | update_object (op->more, action); |
662 | update_object (op->more, action); |
663 | } |
663 | } |
664 | |
664 | |
665 | object *object::first; |
|
|
666 | |
|
|
667 | object::object () |
665 | object::object () |
668 | { |
666 | { |
669 | SET_FLAG (this, FLAG_REMOVED); |
667 | SET_FLAG (this, FLAG_REMOVED); |
670 | |
668 | |
671 | expmul = 1.0; |
669 | expmul = 1.0; |
… | |
… | |
2165 | |
2163 | |
2166 | return 3; |
2164 | return 3; |
2167 | } |
2165 | } |
2168 | |
2166 | |
2169 | /* |
2167 | /* |
2170 | * absdir(int): Returns a number between 1 and 8, which represent |
|
|
2171 | * the "absolute" direction of a number (it actually takes care of |
|
|
2172 | * "overflow" in previous calculations of a direction). |
|
|
2173 | */ |
|
|
2174 | |
|
|
2175 | int |
|
|
2176 | absdir (int d) |
|
|
2177 | { |
|
|
2178 | while (d < 1) |
|
|
2179 | d += 8; |
|
|
2180 | |
|
|
2181 | while (d > 8) |
|
|
2182 | d -= 8; |
|
|
2183 | |
|
|
2184 | return d; |
|
|
2185 | } |
|
|
2186 | |
|
|
2187 | /* |
|
|
2188 | * dirdiff(dir1, dir2) returns how many 45-degrees differences there is |
2168 | * dirdiff(dir1, dir2) returns how many 45-degrees differences there is |
2189 | * between two directions (which are expected to be absolute (see absdir()) |
2169 | * between two directions (which are expected to be absolute (see absdir()) |
2190 | */ |
2170 | */ |
2191 | |
|
|
2192 | int |
2171 | int |
2193 | dirdiff (int dir1, int dir2) |
2172 | dirdiff (int dir1, int dir2) |
2194 | { |
2173 | { |
2195 | int d; |
2174 | int d; |
2196 | |
2175 | |
… | |
… | |
2635 | { |
2614 | { |
2636 | static char info[256 * 4]; |
2615 | static char info[256 * 4]; |
2637 | return debug_desc (info); |
2616 | return debug_desc (info); |
2638 | } |
2617 | } |
2639 | |
2618 | |
|
|
2619 | const char * |
|
|
2620 | object::debug_desc2 () const |
|
|
2621 | { |
|
|
2622 | static char info[256 * 4]; |
|
|
2623 | return debug_desc (info); |
|
|
2624 | } |
|
|
2625 | |