mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-02 06:06:41 +00:00
Verify the player
This commit is contained in:
parent
5856bc8a0e
commit
4ca13a9404
1 changed files with 3 additions and 0 deletions
|
@ -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…
Reference in a new issue