(svn r2820) -Fix: [autoreplace] fixed issue introduced in 2817 where autoreplace failed if new engine is cheaper than the old one (peter1138)
authorbjarni
Sat, 06 Aug 2005 19:12:44 +0000
changeset 2296 6e883aaa77e0
parent 2295 af67e1ea8687
child 2297 0117f7a7c704
(svn r2820) -Fix: [autoreplace] fixed issue introduced in 2817 where autoreplace failed if new engine is cheaper than the old one (peter1138)
vehicle.c
--- a/vehicle.c	Sat Aug 06 17:40:21 2005 +0000
+++ b/vehicle.c	Sat Aug 06 19:12:44 2005 +0000
@@ -1442,7 +1442,7 @@
 
 	/* Check if there is money for the upgrade.. if not, give a nice news-item
 	    (that is needed, because this CMD is called automaticly) */
-	if ( p->money64 < (p->engine_renew_money + build_cost + rear_engine_cost - v->value)) {
+	if ( p->money64 < (int32)(p->engine_renew_money + build_cost + rear_engine_cost - v->value)) {
 		if (( _local_player == v->owner ) && ( v->unitnumber != 0 )) {  //v->unitnumber = 0 for train cars
 			int message;
 			SetDParam(0, v->unitnumber);