diff --git a/src/common/global.h b/src/common/global.h index 5e03536a..716b7118 100644 --- a/src/common/global.h +++ b/src/common/global.h @@ -107,6 +107,7 @@ enum Error ERR_VEH_VIRUS = 400, //! < vehicle infected by a virus ERR_BAT_VIRUS = 401, //! < building infected by a virus ERR_DESTROY_NOTFOUND = 410, //! < not found anything to destroy + ERR_WRONG_OBJ = 420, //! < inappropriate vehicle ERR_VEH_POWER = 500, //! < no battery ERR_VEH_ENERGY = 501, //! < more energy ERR_FLAG_FLY = 510, //! < impossible in flight diff --git a/src/common/restext.cpp b/src/common/restext.cpp index 663a82e9..bbec7ec8 100644 --- a/src/common/restext.cpp +++ b/src/common/restext.cpp @@ -624,6 +624,7 @@ void InitializeRestext() stringsErr[ERR_FLAG_PROXY] = "Too close to an existing flag"; stringsErr[ERR_FLAG_DELETE] = "No flag nearby"; stringsErr[ERR_DESTROY_NOTFOUND]= "Not found anything to destroy"; + stringsErr[ERR_WRONG_OBJ] = "Inappropriate object"; stringsErr[ERR_MISSION_NOTERM] = "The mission is not accomplished yet (press \\key help; for more details)"; stringsErr[ERR_DELETEMOBILE] = "Bot destroyed"; stringsErr[ERR_DELETEBUILDING] = "Building destroyed"; diff --git a/src/script/script.cpp b/src/script/script.cpp index fb9ee933..250f052f 100644 --- a/src/script/script.cpp +++ b/src/script/script.cpp @@ -538,7 +538,7 @@ bool CScript::rBusy(CBotVar* thisclass, CBotVar* var, CBotVar* result, int& exce if ( automat != nullptr ) result->SetValInt(automat->GetBusy()); else - exception = ERR_MANIP_VEH; + exception = ERR_WRONG_OBJ; return true; } @@ -571,7 +571,7 @@ bool CScript::rDestroy(CBotVar* thisclass, CBotVar* var, CBotVar* result, int& e { err = automat->StartAction(0); } else - err = ERR_MANIP_VEH; + err = ERR_WRONG_OBJ; if ( err != ERR_OK ) { @@ -728,7 +728,7 @@ bool CScript::rFactory(CBotVar* thisclass, CBotVar* var, CBotVar* result, int& e else err = ERR_BUILD_DISABLED; } else - err = ERR_MANIP_VEH; + err = ERR_WRONG_OBJ; if ( err != ERR_OK ) {