1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-06-17 07:37:13 +02:00

Fix inspection parameters.

This commit is contained in:
Sandu Liviu Catalin
2021-02-05 15:56:24 +02:00
parent 479272d59f
commit 076d778e50
4 changed files with 16 additions and 16 deletions

View File

@ -304,7 +304,7 @@ void PvClass::AssignParent(const Ref & parent)
}
// ------------------------------------------------------------------------------------------------
bool PvClass::Can(SQInteger id) const
bool PvClass::Can(SQInteger id, SQInteger req) const
{
// Get the current status of the specified entry
SQInteger current = GetEntryValue(id);
@ -314,7 +314,7 @@ bool PvClass::Can(SQInteger id) const
if (!query.IsNull())
{
// Attempt arbitration
LightObj r = query.Eval(current);
LightObj r = query.Eval(current, req);
// If NULL or false the request was denied
if (!r.IsNull() && r.Cast< bool >())
{
@ -415,12 +415,12 @@ void PvClass::EachUnitID(Object & ctx, Function & func)
}
// ================================================================================================
bool SqPvClass::Can(LightObj & obj) const
bool SqPvClass::Can(LightObj & obj, SQInteger req) const
{
// Entry ID?
if (obj.GetType() == OT_INTEGER)
{
return Valid().Can(obj.Cast< SQInteger >());
return Valid().Can(obj.Cast< SQInteger >(), req);
}
// Entry tag?
else if (obj.GetType() == OT_STRING)
@ -443,12 +443,12 @@ bool SqPvClass::Can(LightObj & obj) const
// Generate and cache the hash
tag.CacheHash();
// Forward request
return c.Can(c.ValidManager().GetValidEntryWithTag(tag)->mID);
return c.Can(c.ValidManager().GetValidEntryWithTag(tag)->mID, req);
}
// Entry instance?
else if (obj.GetType() == OT_INSTANCE && obj.GetTypeTag() == StaticClassTypeTag< SqPvEntry >::Get())
{
return Valid().Can(obj.CastI< SqPvEntry >()->Valid().mID);
return Valid().Can(obj.CastI< SqPvEntry >()->Valid().mID, req);
}
STHROWF("Unknown or unsupported entry identification type (%s)", SqTypeName(obj.GetType()));
SQ_UNREACHABLE