mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-21 04:41:35 +00:00
Do not allow deleting the player object (Fixes #2982)
This commit is contained in:
parent
39feb547a0
commit
bc1f7499ab
1 changed files with 3 additions and 0 deletions
|
@ -1073,6 +1073,9 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
if (!ptr.getRefData().isDeleted() && ptr.getContainerStore() == NULL)
|
if (!ptr.getRefData().isDeleted() && ptr.getContainerStore() == NULL)
|
||||||
{
|
{
|
||||||
|
if (ptr == getPlayerPtr())
|
||||||
|
throw std::runtime_error("can not delete player object");
|
||||||
|
|
||||||
ptr.getRefData().setCount(0);
|
ptr.getRefData().setCount(0);
|
||||||
|
|
||||||
if (ptr.isInCell()
|
if (ptr.isInCell()
|
||||||
|
|
Loading…
Reference in a new issue