shield() rejects incorrect robots that try to invoke it (should fix #475)
parent
e1a0f5b1c7
commit
f69dfe3421
src/script
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue