Examining monsters with ctrl-X can lead to message corruption if the title and body fields of the describe_info struct used by process_description take up lines than fit in the message area.
This patch avoid the problem by allowing process_description to print just the title field if title + body would take up too many lines.
Also make view_desc_proc start one line later since it seemed to be trying to print the first line it was given one line above where it should have been.
XVOIH3IL5BCFZHWPXDHOMFPXFSC2WGASR7A36SOM7H7N2OAZXJHAC
if (inf.title.empty())
desc = inf.body.str();
else
{
desc = inf.title + "$$";
desc += inf.body.str();
}
// How mnay lines is the title, we also seem to be adding 1 to
// start with.
int num_lines = count_desc_lines(inf.title, line_width) + 1;
// Maybe skip the body if body + title would be too many lines
if(inf.title.empty())
{
desc = inf.body.str();
// There is a default 1 line addition for some reason
num_lines = body_lines + 1;
}
else if(body_lines + num_lines + 2 <= height)
{
desc = inf.title + "$$";
desc += inf.body.str();
// Got 2 lines from the two $s that weren't counted yet
num_lines += body_lines + 2;
}
else
desc = inf.title + "$";