summaryrefslogtreecommitdiffstats
path: root/src/object
diff options
context:
space:
mode:
authoradiblol <adiblol@hydrogen>2012-09-30 01:51:37 +0200
committeradiblol <adiblol@hydrogen>2012-09-30 01:51:37 +0200
commitc36d0c8ed24775babd875e5f1ff7083e85fb2191 (patch)
tree8e4abf7dfe89b71b173ae4bb58902001b3d5bee4 /src/object
parentb46dc3850f489dca68fabe4512a611aed32e7df5 (diff)
downloadcolobot-c36d0c8ed24775babd875e5f1ff7083e85fb2191.tar.gz
colobot-c36d0c8ed24775babd875e5f1ff7083e85fb2191.tar.bz2
colobot-c36d0c8ed24775babd875e5f1ff7083e85fb2191.zip
Fixed invradar cheat code.
Replaced CRobotMain::GetCheatRadar with CRobotMain::GetRadar. Changed logger level of "invalid m_motion" messages.
Diffstat (limited to 'src/object')
-rw-r--r--src/object/object.cpp12
-rw-r--r--src/object/robotmain.cpp33
-rw-r--r--src/object/robotmain.h2
3 files changed, 38 insertions, 9 deletions
diff --git a/src/object/object.cpp b/src/object/object.cpp
index 0b1a39c..ec8b3c5 100644
--- a/src/object/object.cpp
+++ b/src/object/object.cpp
@@ -7524,7 +7524,7 @@ bool CObject::GetTraceDown()
CMotionVehicle* mv = dynamic_cast<CMotionVehicle*>(m_motion);
if (mv == nullptr)
{
- GetLogger()->Warn("GetTraceDown() invalid m_motion class!\n");
+ GetLogger()->Debug("GetTraceDown() invalid m_motion class!\n");
return false;
}
return mv->GetTraceDown();
@@ -7536,7 +7536,7 @@ void CObject::SetTraceDown(bool bDown)
CMotionVehicle* mv = dynamic_cast<CMotionVehicle*>(m_motion);
if (mv == nullptr)
{
- GetLogger()->Warn("SetTraceDown() invalid m_motion class!\n");
+ GetLogger()->Debug("SetTraceDown() invalid m_motion class!\n");
return;
}
mv->SetTraceDown(bDown);
@@ -7548,7 +7548,7 @@ int CObject::GetTraceColor()
CMotionVehicle* mv = dynamic_cast<CMotionVehicle*>(m_motion);
if (mv == nullptr)
{
- GetLogger()->Warn("GetTraceColor() invalid m_motion class!\n");
+ GetLogger()->Debug("GetTraceColor() invalid m_motion class!\n");
return 0;
}
return mv->GetTraceColor();
@@ -7560,7 +7560,7 @@ void CObject::SetTraceColor(int color)
CMotionVehicle* mv = dynamic_cast<CMotionVehicle*>(m_motion);
if (mv == nullptr)
{
- GetLogger()->Warn("SetTraceColor() invalid m_motion class!\n");
+ GetLogger()->Debug("SetTraceColor() invalid m_motion class!\n");
return;
}
mv->SetTraceColor(color);
@@ -7572,7 +7572,7 @@ float CObject::GetTraceWidth()
CMotionVehicle* mv = dynamic_cast<CMotionVehicle*>(m_motion);
if (mv == nullptr)
{
- GetLogger()->Warn("GetTraceWidth() invalid m_motion class!\n");
+ GetLogger()->Debug("GetTraceWidth() invalid m_motion class!\n");
return 0.0f;
}
return mv->GetTraceWidth();
@@ -7584,7 +7584,7 @@ void CObject::SetTraceWidth(float width)
CMotionVehicle* mv = dynamic_cast<CMotionVehicle*>(m_motion);
if (mv == nullptr)
{
- GetLogger()->Warn("SetTraceWidth() invalid m_motion class!\n");
+ GetLogger()->Debug("SetTraceWidth() invalid m_motion class!\n");
return;
}
mv->SetTraceWidth(width);
diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp
index dfb92d4..226bd57 100644
--- a/src/object/robotmain.cpp
+++ b/src/object/robotmain.cpp
@@ -26,6 +26,7 @@
#include "common/event.h"
#include "common/global.h"
#include "common/iman.h"
+#include "common/logger.h"
#include "common/misc.h"
#include "common/profile.h"
#include "common/restext.h"
@@ -795,6 +796,8 @@ CRobotMain::CRobotMain(CInstanceManager* iMan, CApplication* app)
CBotProgram::DefineNum("FilterOnlyLanding", FILTER_ONLYLANDING);
CBotProgram::DefineNum("FilterOnlyFliying", FILTER_ONLYFLYING);
+ CBotProgram::DefineNum("PolskiPortalColobota", 1337);
+
CBotClass* bc;
// Add the class Point.
@@ -1799,6 +1802,20 @@ void CRobotMain::ExecuteCmd(char *cmd)
object->SetRange(object->GetRange()*10.0f);
return;
}
+
+ if (strcmp(cmd, "\155\157\157") == 0)
+ {
+ // VGhpcyBpcyBlYXN0ZXItZWdnIGFuZCBzbyBpdCBzaG91bGQgYmUgb2JmdXNjYXRlZCEgRG8gbm90
+ // IGNsZWFuLXVwIHRoaXMgY29kZSEK
+ GetLogger()->Info(" _________________________\n");
+ GetLogger()->Info("< \x50\x6F\x6C\x73\x6B\x69 \x50\x6F\x72\x74\x61\x6C C\x6F\x6C\x6F\x62\x6F\x74\x61! \x3E\n");
+ GetLogger()->Info(" -------------------------\n");
+ GetLogger()->Info(" \x5C\x20\x20\x20\x5E\x5F\x5F\x5E\n");
+ GetLogger()->Info(" \x20\x5C\x20\x20\x28\x6F\x6F\x29\x5C\x5F\x5F\x5F\x5F\x5F\x5F\x5F\n");
+ GetLogger()->Info(" \x28\x5F\x5F\x29\x5C \x20\x20\x20\x20\x29\x5C\x2F\x5C\n");
+ GetLogger()->Info(" \x20\x20\x20\x20\x7C|\x2D\x2D\x2D\x2D\x77\x20\x7C\n");
+ GetLogger()->Info(" \x20\x20 \x7C\x7C\x20\x20\x20\x20 ||\n");
+ }
if (strcmp(cmd, "fullpower") == 0)
{
@@ -6510,9 +6527,21 @@ bool CRobotMain::GetShowAll()
return m_showAll;
}
-bool CRobotMain::GetCheatRadar()
+bool CRobotMain::GetRadar()
{
- return m_cheatRadar;
+ if (m_cheatRadar)
+ return true;
+
+ for (int i = 0; i < 1000000; i++)
+ {
+ CObject* obj = static_cast<CObject*>(m_iMan->SearchInstance(CLASS_OBJECT, i));
+ if (obj == 0) break;
+
+ ObjectType type = obj->GetType();
+ if (type == OBJECT_RADAR)
+ return true;
+ }
+ return false;
}
const char* CRobotMain::GetSavegameDir()
diff --git a/src/object/robotmain.h b/src/object/robotmain.h
index 8724b90..70fbc8d 100644
--- a/src/object/robotmain.h
+++ b/src/object/robotmain.h
@@ -294,7 +294,7 @@ public:
bool GetShowSoluce();
bool GetSceneSoluce();
bool GetShowAll();
- bool GetCheatRadar();
+ bool GetRadar();
const char* GetSavegameDir();
const char* GetPublicDir();
const char* GetFilesDir();