--- deliantra/server/include/util.h 2006/12/17 23:10:35 1.20 +++ deliantra/server/include/util.h 2006/12/23 06:21:02 1.22 @@ -56,6 +56,10 @@ template inline T *salloc (int n, T *src) throw (std::bad_alloc) { return (T *)salloc_ (n * sizeof (T), (void *)src); } +// clears the memory +template +inline T *salloc0(int n = 1) throw (std::bad_alloc) { return (T *)salloc_ (n * sizeof (T), 0); } + // for symmetry template inline void sfree (T *ptr, int n = 1) throw () @@ -164,6 +168,10 @@ operator T *() const { return p; } }; +typedef refptr player_ptr; +typedef refptr object_ptr; +typedef refptr arch_ptr; + struct str_hash { std::size_t operator ()(const char *s) const