fix a server crash on attempting to checksum a model that isn't there

This commit is contained in:
Bill Currie 2001-01-19 21:45:38 +00:00
parent de137aa864
commit a01e68a148

View file

@ -280,14 +280,16 @@ SV_CheckModel (char *mdl)
{
byte stackbuf[1024]; // avoid dirtying the cache heap
byte *buf;
unsigned short crc;
unsigned short crc = 0;
// int len;
buf = (byte *) COM_LoadStackFile (mdl, stackbuf, sizeof (stackbuf));
if (buf) {
crc = CRC_Block (buf, com_filesize);
// for (len = com_filesize; len; len--, buf++)
// CRC_ProcessByte(&crc, *buf);
} else {
Con_Printf ("WARNING: cannot generate checksum for %s\n", mdl);
}
return crc;
}