shield() rejects incorrect robots that try to invoke it (should fix #475)
parent
e1a0f5b1c7
commit
f69dfe3421
|
@ -2628,6 +2628,18 @@ bool CScriptFunctions::rShield(CBotVar* var, CBotVar* result, int& exception, vo
|
||||||
CObject* pThis = static_cast<CObject *>(user);
|
CObject* pThis = static_cast<CObject *>(user);
|
||||||
float oper, radius;
|
float oper, radius;
|
||||||
Error err;
|
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
|
oper = var->GetValFloat(); // 0=down, 1=up
|
||||||
var = var->GetNext();
|
var = var->GetNext();
|
||||||
|
|
Loading…
Reference in New Issue