Add trainer=1 BotFactory

modernize-cmake-1
Fiftytwo 2018-07-12 19:55:31 +02:00
parent 5e606336ca
commit d0e29d4875
2 changed files with 69 additions and 65 deletions

View File

@ -661,6 +661,7 @@ bool CAutoFactory::CreateVehicle()
params.angle = angle;
params.type = m_type;
params.team = m_object->GetTeam();
params.trainer = m_object->GetTrainer();
CObject* vehicle = CObjectManager::GetInstancePointer()->CreateObject(params);
vehicle->SetLock(true); // not usable
@ -726,7 +727,8 @@ bool CAutoFactory::CreateInterface(bool bSelect)
oy = 3.0f/480.0f;
sx = 33.0f/640.0f;
sy = 33.0f/480.0f;
if( !m_object->GetTrainer() )
{
pos.x = 0.0f;
pos.y = oy+sy*2.6f;
ddim.x = 138.0f/640.0f;
@ -796,6 +798,7 @@ bool CAutoFactory::CreateInterface(bool bSelect)
pos.x = ox+sx*0.0f;
pos.y = oy+sy*2.7f;
pw->CreateButton(pos, dim, 128+21, EVENT_OBJECT_FACTORYsa);
}
pos.x = ox+sx*0.0f;
pos.y = oy+sy*0;

View File

@ -64,6 +64,7 @@ std::unique_ptr<CBaseBuilding> CBaseBuilding::Create(
{
auto obj = MakeUnique<CBaseBuilding>(params.id, params.type);
obj->SetTrainer(params.trainer);
obj->SetTeam(params.team);
float height = params.height;