Skip to content

Commit 7912d8c

Browse files
committed
Moved MSG_CityDistressReport checking
- Moved the check to MSG_CityDistressReport messages to HCity object as an CompareMail override.
1 parent 22103ad commit 7912d8c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

HCity.cs

+8
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,14 @@ public HCity(HMail mail)
254254
{
255255
}
256256

257+
public override void CompareMail(HMail mail)
258+
{
259+
// This is a small fix to not count MSG_CityDistressReport messages with no report info.
260+
if (!(mail.Body.Contains("<b>MORALE</b>") || mail.Body.Contains("<b>POPULATION</b>")))
261+
return;
262+
base.CompareMail(mail);
263+
}
264+
257265
public override void Initialize()
258266
{
259267
if (_mail.Body.Remove(4) == "UTC:")

HMail.cs

-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ static public bool IsUni4(string filePath)
3434
}
3535
static public bool IsCityReport(HMail mail) // Same as above but mail input.
3636
{
37-
// This is a small fix to not count MSG_CityDistressReport messages with no report info.
38-
if (!(mail.Body.Contains("<b>MORALE</b>") || mail.Body.Contains("<b>POPULATION</b>")))
39-
return false;
40-
4137
return IsCityReport(mail.MessageType);
4238
}
4339
static public bool IsCityReport(byte[] mailBytes) // Same as above but mailBytes input.

0 commit comments

Comments
 (0)