engine/EngineHostCommand.c
/*	Writes a SAVEGAME_COMMENT_LENGTH character comment describing the current
*/
Writes a SAVEGAME_COMMENT_LENGTH character comment describing the current
Writes a SAVEGAME_COMMENT_LENGTH character comment describing the current
void Host_SavegameComment (char *text)
{
	int		i;
	char	kills[20];
	for (i=0 ; i<SAVEGAME_COMMENT_LENGTH ; i++)
		text[i] = ' ';
	memcpy(text,cl.levelname,Math_Min(strlen(cl.levelname),22)); 
	sprintf(kills,"kills:%3i/%3i", cl.stats[STAT_MONSTERS], cl.stats[STAT_TOTALMONSTERS]);
	memcpy(text+22,kills,strlen(kills));
	for (i=0 ; i<SAVEGAME_COMMENT_LENGTH ; i++)
		if (text[i] == ' ')
			text[i] = '_';
	text[SAVEGAME_COMMENT_LENGTH] = '\0';
}
void Host_SavegameComment ( char * text ) { int i ; char kills [ 20 ] ; for ( i = 0 ; i < SAVEGAME_COMMENT_LENGTH ; i ++ ) text [ i ] = ' ' ; memcpy ( text , cl . levelname , Math_Min ( strlen ( cl . levelname ) , 22 ) ) ; sprintf ( kills , " " , cl . stats [ STAT_MONSTERS ] , cl . stats [ STAT_TOTALMONSTERS ] ) ; memcpy ( text + 22 , kills , strlen ( kills ) ) ; for ( i = 0 ; i < SAVEGAME_COMMENT_LENGTH ; i ++ ) if ( text [ i ] == ' ' ) text [ i ] = ' ' ; text [ SAVEGAME_COMMENT_LENGTH ] = ' \0 ' ; }
Writes a SAVEGAME_COMMENT_LENGTH character comment describing the current
Writes a SAVEGAME_COMMENT_LENGTH character comment describing the current
//johnfitz -- only copy 22 chars. // Convert space to _ to make stdio happy