Verify the player

pull/3235/head
Zackhasacat 1 month ago
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…
Cancel
Save