--- deliantra/server/include/face.h 2009/11/03 23:44:21 1.28 +++ deliantra/server/include/face.h 2010/04/14 02:31:24 1.34 @@ -1,7 +1,7 @@ /* * This file is part of Deliantra, the Roguelike Realtime MMORPG. * - * Copyright (©) 2005,2006,2007,2008,2009 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team * * Deliantra is free software: you can redistribute it and/or modify it under * the terms of the Affero GNU General Public License as published by the @@ -26,17 +26,22 @@ #include #include -#define CHKSUM_SIZE 6 +#define CHKSUM_MAXLEN 15 #define MAX_FACES 10000 // stupid gcfclient artificially limits typedef uint16 faceidx; -extern faceidx blank_face, empty_face; +extern faceidx blank_face, empty_face, magicmouth_face; struct facedata { std::string data; - uint8 chksum[CHKSUM_SIZE]; + uint8 chksum[CHKSUM_MAXLEN]; + uint8 chksum_len; + + facedata () + : chksum_len (0) + { } }; /* New face structure - this enforces the notion that data is face by @@ -65,9 +70,12 @@ }; inline void -object_freezer::put (keyword k, faceinfo *v) +object_freezer::put (const keyword_string k, faceinfo *v) { - put (k, v ? &v->name : (const char *)0); + if (expect_true (v)) + put (k, v->name); + else + put (k); } typedef std::tr1::unordered_map > > facehash_t; @@ -113,7 +121,6 @@ typedef std::tr1::unordered_map > > animhash_t; -extern animhash_t animhash; extern std::vector animations; #endif