(svn r19432) -Fix [FS#3696] (r19357): crash when the error message 'owned by <town>' was shown

This commit is contained in:
yexo 2010-03-16 06:25:35 +00:00
parent ef8deb2edd
commit 43be04eb27

View File

@ -553,7 +553,7 @@ public:
this->detailed_msg = detailed_msg; this->detailed_msg = detailed_msg;
CompanyID company = (CompanyID)GetDParamX(this->decode_params, 2); CompanyID company = (CompanyID)GetDParamX(this->decode_params, 2);
this->face = (this->detailed_msg == STR_ERROR_OWNED_BY && company <= MAX_COMPANIES) ? company : INVALID_COMPANY; this->face = (this->detailed_msg == STR_ERROR_OWNED_BY && company < MAX_COMPANIES) ? company : INVALID_COMPANY;
const WindowDesc *desc = (face == INVALID_COMPANY) ? &_errmsg_desc : &_errmsg_face_desc; const WindowDesc *desc = (face == INVALID_COMPANY) ? &_errmsg_desc : &_errmsg_face_desc;
assert(summary_msg != INVALID_STRING_ID); assert(summary_msg != INVALID_STRING_ID);