shield() rejects incorrect robots that try to invoke it (should fix )

master
Tomasz Kapuściński 2015-05-28 14:03:05 +02:00
parent e1a0f5b1c7
commit f69dfe3421
1 changed files with 12 additions and 0 deletions
src/script

View File

@ -2629,6 +2629,18 @@ bool CScriptFunctions::rShield(CBotVar* var, CBotVar* result, int& exception, vo
float oper, radius;
Error err;
// only shielder can use shield()
if (pThis->GetType() != OBJECT_MOBILErs)
{
result->SetValInt(ERR_MANIP_VEH); // return error
if (script->m_errMode == ERM_STOP)
{
exception = ERR_MANIP_VEH;
return false;
}
return true;
}
oper = var->GetValFloat(); // 0=down, 1=up
var = var->GetNext();