summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_group.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ai/api/ai_group.cpp')
-rw-r--r--src/ai/api/ai_group.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ai/api/ai_group.cpp b/src/ai/api/ai_group.cpp
index b1ececbe1..5974132c9 100644
--- a/src/ai/api/ai_group.cpp
+++ b/src/ai/api/ai_group.cpp
@@ -112,7 +112,7 @@
/* static */ bool AIGroup::SetAutoReplace(GroupID group_id, EngineID engine_id_old, EngineID engine_id_new)
{
- EnforcePrecondition(false, IsValidGroup(group_id) || group_id == GROUP_ALL);
+ EnforcePrecondition(false, IsValidGroup(group_id) || group_id == GROUP_DEFAULT || group_id == GROUP_ALL);
EnforcePrecondition(false, AIEngine::IsBuildable(engine_id_new));
return AIObject::DoCommand(0, group_id << 16, (engine_id_new << 16) | engine_id_old, CMD_SET_AUTOREPLACE);
@@ -120,14 +120,14 @@
/* static */ EngineID AIGroup::GetEngineReplacement(GroupID group_id, EngineID engine_id)
{
- if (!IsValidGroup(group_id) && group_id != GROUP_ALL) return ::INVALID_ENGINE;
+ if (!IsValidGroup(group_id) && group_id != GROUP_DEFAULT && group_id != GROUP_ALL) return ::INVALID_ENGINE;
return ::EngineReplacementForCompany(Company::Get(_current_company), engine_id, group_id);
}
/* static */ bool AIGroup::StopAutoReplace(GroupID group_id, EngineID engine_id)
{
- EnforcePrecondition(false, IsValidGroup(group_id) || group_id == GROUP_ALL);
+ EnforcePrecondition(false, IsValidGroup(group_id) || group_id == GROUP_DEFAULT || group_id == GROUP_ALL);
return AIObject::DoCommand(0, group_id << 16, (::INVALID_ENGINE << 16) | engine_id, CMD_SET_AUTOREPLACE);
}