ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/object.C
(Generate patch)

Comparing deliantra/server/common/object.C (file contents):
Revision 1.114 by root, Sun Jan 14 22:06:05 2007 UTC vs.
Revision 1.115 by root, Mon Jan 15 01:39:42 2007 UTC

2163 2163
2164 return 3; 2164 return 3;
2165} 2165}
2166 2166
2167/* 2167/*
2168 * absdir(int): Returns a number between 1 and 8, which represent
2169 * the "absolute" direction of a number (it actually takes care of
2170 * "overflow" in previous calculations of a direction).
2171 */
2172
2173int
2174absdir (int d)
2175{
2176 while (d < 1)
2177 d += 8;
2178
2179 while (d > 8)
2180 d -= 8;
2181
2182 return d;
2183}
2184
2185/*
2186 * dirdiff(dir1, dir2) returns how many 45-degrees differences there is 2168 * dirdiff(dir1, dir2) returns how many 45-degrees differences there is
2187 * between two directions (which are expected to be absolute (see absdir()) 2169 * between two directions (which are expected to be absolute (see absdir())
2188 */ 2170 */
2189
2190int 2171int
2191dirdiff (int dir1, int dir2) 2172dirdiff (int dir1, int dir2)
2192{ 2173{
2193 int d; 2174 int d;
2194 2175

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines