mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-29 09:32:45 +00:00
Verify the player
This commit is contained in:
parent
5856bc8a0e
commit
4ca13a9404
@ -187,6 +187,9 @@ namespace MWLua
|
||||
return cls.getNpcStats(o.ptr()).getBounty();
|
||||
};
|
||||
player["setCrimeLevel"] = [](const Object& o, int amount) {
|
||||
verifyPlayer(o);
|
||||
if (!dynamic_cast<const GObject*>(&o))
|
||||
throw std::runtime_error("Only global scripts can change crime level");
|
||||
const MWWorld::Class& cls = o.ptr().getClass();
|
||||
cls.getNpcStats(o.ptr()).setBounty(amount);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user