mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
Issue #68: Stop player from dying (temporary workaround)
This commit is contained in:
parent
0ab432b074
commit
21c24dedb6
@ -213,7 +213,27 @@ namespace MWMechanics
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (MWWorld::Class::get (*iter).getCreatureStats (*iter).isDead())
|
if (MWWorld::Class::get (*iter).getCreatureStats (*iter).isDead())
|
||||||
|
{
|
||||||
|
// workaround: always keep player alive for now
|
||||||
|
// \todo remove workaround, once player death can be handled
|
||||||
|
if (iter->getRefData().getHandle()=="player")
|
||||||
|
{
|
||||||
|
MWMechanics::DynamicStat<float> stat (
|
||||||
|
MWWorld::Class::get (*iter).getCreatureStats (*iter).getHealth());
|
||||||
|
|
||||||
|
if (stat.getModified()<1)
|
||||||
|
{
|
||||||
|
stat.setModified (1, 0);
|
||||||
|
MWWorld::Class::get (*iter).getCreatureStats (*iter).setHealth (stat);
|
||||||
|
}
|
||||||
|
|
||||||
|
MWWorld::Class::get (*iter).getCreatureStats (*iter).resurrect();
|
||||||
|
++iter;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
mActors.erase (iter++);
|
mActors.erase (iter++);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user