summaryrefslogtreecommitdiffstats
path: root/src/object/robotmain.cpp
diff options
context:
space:
mode:
authorkrzys-h <krzys_h@interia.pl>2014-03-03 21:55:28 +0100
committerkrzys-h <krzys_h@interia.pl>2014-03-03 21:55:28 +0100
commitfbe2bf8bc7d61a7a13759f56e65181e16e25806b (patch)
treea44ca49a4b91d67cb22f5c026b6cd141574790cc /src/object/robotmain.cpp
parenta806d4257ce3f10a23441cfa962b9caf5deebb85 (diff)
downloadcolobot-fbe2bf8bc7d61a7a13759f56e65181e16e25806b.tar.gz
colobot-fbe2bf8bc7d61a7a13759f56e65181e16e25806b.tar.bz2
colobot-fbe2bf8bc7d61a7a13759f56e65181e16e25806b.zip
Added special mode in scene for bots to build more buildings than they usualy can
Will be used in "Leaving Earth" missions for making decorative bots building base
Diffstat (limited to 'src/object/robotmain.cpp')
-rw-r--r--src/object/robotmain.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp
index c71c437..011cab8 100644
--- a/src/object/robotmain.cpp
+++ b/src/object/robotmain.cpp
@@ -4593,6 +4593,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
{
m_controller = CObjectManager::GetInstancePointer()->CreateObject(Math::Vector(0.0f, 0.0f, 0.0f), 0.0f, OBJECT_CONTROLLER, 100.0f);
m_controller->SetMagnifyDamage(100.0f);
+ m_controller->SetIgnoreBuildCheck(true);
CBrain* brain = m_controller->GetBrain();
if (brain != nullptr)
{
@@ -4720,6 +4721,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
bool selectable = OpInt(line, "selectable", 1);
obj->SetSelectable(selectable);
+ obj->SetIgnoreBuildCheck(OpInt(line, "ignoreBuildCheck", 0));
obj->SetEnable(OpInt(line, "enable", 1));
obj->SetProxyActivate(OpInt(line, "proxyActivate", 0));
obj->SetProxyDistance(OpFloat(line, "proxyDistance", 15.0f)*g_unit);
@@ -6068,6 +6070,9 @@ void CRobotMain::IOWriteObject(FILE *file, CObject* obj, const char *cmd)
sprintf(name, " trainer=%d", obj->GetTrainer());
strcat(line, name);
+
+ sprintf(name, " ignoreBuildCheck=%d", obj->GetIgnoreBuildCheck());
+ strcat(line, name);
sprintf(name, " option=%d", obj->GetOption());
strcat(line, name);
@@ -6229,6 +6234,7 @@ CObject* CRobotMain::IOReadObject(char *line, const char* filename, int objRank)
obj->SetDefRank(objRank);
obj->SetPosition(0, pos);
obj->SetAngle(0, dir);
+ obj->SetIgnoreBuildCheck(OpInt(line, "ignoreBuildCheck", 0));
obj->SetID(id);
if (g_id < id) g_id = id;