mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(svn r21605) -Fix [FS#4324]: crash due to cargo payments belonging to an non-existing company
This commit is contained in:
parent
3de71010d6
commit
308da265ef
@ -382,6 +382,9 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner)
|
||||
v->colourmap = PAL_NONE;
|
||||
if (v->IsEngineCountable()) Company::Get(new_owner)->num_engines[v->engine_type]++;
|
||||
if (v->IsPrimaryVehicle()) v->unitnumber = unitidgen[v->type].NextID();
|
||||
|
||||
/* Invalidate the vehicle's cargo payment "owner cache". */
|
||||
if (v->cargo_payment != NULL) v->cargo_payment->owner = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user