mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(svn r11872) -Fix (r9874): EngineHasReplacementForPlayer() didn't look in ALL_GROUP
This commit is contained in:
parent
61e40b1aa5
commit
48c2669185
@ -507,6 +507,10 @@ void RemoveAllEngineReplacement(EngineRenewList *erl)
|
||||
EngineID EngineReplacement(EngineRenewList erl, EngineID engine, GroupID group)
|
||||
{
|
||||
const EngineRenew *er = GetEngineReplacement(erl, engine, group);
|
||||
if (er == NULL && (group == DEFAULT_GROUP || (IsValidGroupID(group) && !GetGroup(group)->replace_protection))) {
|
||||
/* We didn't find anything useful in the vehicle's own group so we will try ALL_GROUP */
|
||||
er = GetEngineReplacement(erl, engine, ALL_GROUP);
|
||||
}
|
||||
return er == NULL ? INVALID_ENGINE : er->to;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user