--- deliantra/server/include/util.h 2007/01/15 01:25:41 1.28 +++ deliantra/server/include/util.h 2007/01/15 01:39:42 1.29 @@ -64,6 +64,16 @@ #endif } +/* + * absdir(int): Returns a number between 1 and 8, which represent + * the "absolute" direction of a number (it actually takes care of + * "overflow" in previous calculations of a direction). + */ +inline int +absdir (int d) +{ + return ((d - 1) & 7) + 1; +} // makes dynamically allocated objects zero-initialised struct zero_initialised