mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 08:39:42 +00:00
Prevent being in a menu from disabling script execution or actor damage
This commit is contained in:
parent
cc40b85034
commit
aaf4cc0d7e
3 changed files with 16 additions and 1 deletions
|
@ -104,12 +104,14 @@ void OMW::Engine::frame(float frametime)
|
||||||
mwmp::Main::Frame(frametime);
|
mwmp::Main::Frame(frametime);
|
||||||
|
|
||||||
// Main menu opened? Then scripts are also paused.
|
// Main menu opened? Then scripts are also paused.
|
||||||
bool paused = mEnvironment.getWindowManager()->containsMode(MWGui::GM_MainMenu);
|
bool paused = /*mEnvironment.getWindowManager()->containsMode(MWGui::GM_MainMenu);*/ false;
|
||||||
|
// The above is overridden by tes3mp, where the game should never be pausable
|
||||||
|
|
||||||
// update game state
|
// update game state
|
||||||
mEnvironment.getStateManager()->update (frametime);
|
mEnvironment.getStateManager()->update (frametime);
|
||||||
|
|
||||||
bool guiActive = /*mEnvironment.getWindowManager()->isGuiMode()*/ false;
|
bool guiActive = /*mEnvironment.getWindowManager()->isGuiMode()*/ false;
|
||||||
|
// The above is overridden by tes3mp, where the Gui being active doesn't matter
|
||||||
|
|
||||||
osg::Timer_t beforeScriptTick = osg::Timer::instance()->tick();
|
osg::Timer_t beforeScriptTick = osg::Timer::instance()->tick();
|
||||||
if (mEnvironment.getStateManager()->getState()==
|
if (mEnvironment.getStateManager()->getState()==
|
||||||
|
@ -693,6 +695,8 @@ void OMW::Engine::go()
|
||||||
dt = std::min(dt, 0.2);
|
dt = std::min(dt, 0.2);
|
||||||
|
|
||||||
bool guiActive = /*mEnvironment.getWindowManager()->isGuiMode()*/ false;
|
bool guiActive = /*mEnvironment.getWindowManager()->isGuiMode()*/ false;
|
||||||
|
// The above is overridden by tes3mp, where the Gui being active doesn't matter
|
||||||
|
|
||||||
if (!guiActive)
|
if (!guiActive)
|
||||||
simulationTime += dt;
|
simulationTime += dt;
|
||||||
|
|
||||||
|
|
|
@ -210,7 +210,12 @@ namespace MWScript
|
||||||
|
|
||||||
bool InterpreterContext::menuMode()
|
bool InterpreterContext::menuMode()
|
||||||
{
|
{
|
||||||
|
/* Disabled by tes3mp, because being in a menu should not pause scripts in it
|
||||||
|
|
||||||
return MWBase::Environment::get().getWindowManager()->isGuiMode();
|
return MWBase::Environment::get().getWindowManager()->isGuiMode();
|
||||||
|
*/
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int InterpreterContext::getGlobalShort (const std::string& name) const
|
int InterpreterContext::getGlobalShort (const std::string& name) const
|
||||||
|
|
|
@ -2327,8 +2327,11 @@ namespace MWWorld
|
||||||
|
|
||||||
void World::hurtStandingActors(const ConstPtr &object, float healthPerSecond)
|
void World::hurtStandingActors(const ConstPtr &object, float healthPerSecond)
|
||||||
{
|
{
|
||||||
|
/* Disabled by tes3mp, because being in a menu should not pause the game in it
|
||||||
|
|
||||||
if (MWBase::Environment::get().getWindowManager()->isGuiMode())
|
if (MWBase::Environment::get().getWindowManager()->isGuiMode())
|
||||||
return;
|
return;
|
||||||
|
*/
|
||||||
|
|
||||||
std::vector<MWWorld::Ptr> actors;
|
std::vector<MWWorld::Ptr> actors;
|
||||||
mPhysics->getActorsStandingOn(object, actors);
|
mPhysics->getActorsStandingOn(object, actors);
|
||||||
|
@ -2357,8 +2360,11 @@ namespace MWWorld
|
||||||
|
|
||||||
void World::hurtCollidingActors(const ConstPtr &object, float healthPerSecond)
|
void World::hurtCollidingActors(const ConstPtr &object, float healthPerSecond)
|
||||||
{
|
{
|
||||||
|
/* Disabled by tes3mp, because being in a menu should not pause the game in it
|
||||||
|
|
||||||
if (MWBase::Environment::get().getWindowManager()->isGuiMode())
|
if (MWBase::Environment::get().getWindowManager()->isGuiMode())
|
||||||
return;
|
return;
|
||||||
|
*/
|
||||||
|
|
||||||
std::vector<MWWorld::Ptr> actors;
|
std::vector<MWWorld::Ptr> actors;
|
||||||
mPhysics->getActorsCollidingWith(object, actors);
|
mPhysics->getActorsCollidingWith(object, actors);
|
||||||
|
|
Loading…
Reference in a new issue