economy.c
branch0.5
changeset 5372 f31443540a55
parent 5370 fb39e4250252
child 5375 44fe20777771
--- a/economy.c	Sat Dec 30 23:21:02 2006 +0000
+++ b/economy.c	Sat Dec 30 23:21:55 2006 +0000
@@ -848,6 +848,19 @@
 	return tp;
 }
 
+void DeleteSubsidyWithTown(TownID index)
+{
+	Subsidy *s;
+
+	for (s = _subsidies; s != endof(_subsidies); s++) {
+		if (s->cargo_type != CT_INVALID && s->age < 12 &&
+				(((s->cargo_type == CT_PASSENGERS || s->cargo_type == CT_MAIL) && (index == s->from || index == s->to)) ||
+				((s->cargo_type == CT_GOODS || s->cargo_type == CT_FOOD) && index == s->to))) {
+			s->cargo_type = CT_INVALID;
+		}
+	}
+}
+
 void DeleteSubsidyWithIndustry(IndustryID index)
 {
 	Subsidy *s;
@@ -855,7 +868,7 @@
 	for (s = _subsidies; s != endof(_subsidies); s++) {
 		if (s->cargo_type != CT_INVALID && s->age < 12 &&
 				s->cargo_type != CT_PASSENGERS && s->cargo_type != CT_MAIL &&
-				(index == s->from || (s->cargo_type!=CT_GOODS && s->cargo_type!=CT_FOOD && index==s->to))) {
+				(index == s->from || (s->cargo_type != CT_GOODS && s->cargo_type != CT_FOOD && index == s->to))) {
 			s->cargo_type = CT_INVALID;
 		}
 	}