mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 18:39:40 +00:00
[Client] Once again allow beds to be used even if waiting is disallowed
This had been broken by rest-related commits in OpenMW.
This commit is contained in:
parent
c4950f1beb
commit
5b4db83d61
6 changed files with 15 additions and 1 deletions
|
@ -161,7 +161,8 @@ namespace MWGui
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox("You are not allowed to rest in the wilderness.");
|
MWBase::Environment::get().getWindowManager()->messageBox("You are not allowed to rest in the wilderness.");
|
||||||
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
}
|
}
|
||||||
else if (canRest == MWBase::World::Rest_OnlyWaiting && !mwmp::Main::get().getLocalPlayer()->waitAllowed)
|
else if (canRest == MWBase::World::Rest_OnlyWaiting && !mwmp::Main::get().getLocalPlayer()->waitAllowed &&
|
||||||
|
!mwmp::Main::get().getLocalPlayer()->isUsingBed)
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox("You are not allowed to wait.");
|
MWBase::Environment::get().getWindowManager()->messageBox("You are not allowed to wait.");
|
||||||
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
|
|
|
@ -1300,9 +1300,14 @@ namespace MWInput
|
||||||
Start of tes3mp addition
|
Start of tes3mp addition
|
||||||
|
|
||||||
Ignore attempts to rest if the player has not logged in on the server yet
|
Ignore attempts to rest if the player has not logged in on the server yet
|
||||||
|
|
||||||
|
Set LocalPlayer's isUsingBed to be able to distinguish bed use from regular rest
|
||||||
|
menu use
|
||||||
*/
|
*/
|
||||||
if (!mwmp::Main::get().getLocalPlayer()->isLoggedIn())
|
if (!mwmp::Main::get().getLocalPlayer()->isLoggedIn())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
mwmp::Main::get().getLocalPlayer()->isUsingBed = false;
|
||||||
/*
|
/*
|
||||||
End of tes3mp addition
|
End of tes3mp addition
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -74,6 +74,7 @@ LocalPlayer::LocalPlayer()
|
||||||
jailProgressText = "";
|
jailProgressText = "";
|
||||||
jailEndText = "";
|
jailEndText = "";
|
||||||
|
|
||||||
|
isUsingBed = false;
|
||||||
isReceivingInventory = false;
|
isReceivingInventory = false;
|
||||||
isReceivingQuickKeys = false;
|
isReceivingQuickKeys = false;
|
||||||
isPlayingAnimation = false;
|
isPlayingAnimation = false;
|
||||||
|
|
|
@ -18,6 +18,7 @@ namespace mwmp
|
||||||
time_t deathTime;
|
time_t deathTime;
|
||||||
bool receivedCharacter;
|
bool receivedCharacter;
|
||||||
|
|
||||||
|
bool isUsingBed;
|
||||||
bool isReceivingInventory;
|
bool isReceivingInventory;
|
||||||
bool isReceivingQuickKeys;
|
bool isReceivingQuickKeys;
|
||||||
bool isPlayingAnimation;
|
bool isPlayingAnimation;
|
||||||
|
|
|
@ -24,6 +24,9 @@ namespace mwmp
|
||||||
if (isLocal())
|
if (isLocal())
|
||||||
{
|
{
|
||||||
LOG_MESSAGE_SIMPLE(TimedLog::LOG_INFO, "Received ID_GAME_SETTINGS");
|
LOG_MESSAGE_SIMPLE(TimedLog::LOG_INFO, "Received ID_GAME_SETTINGS");
|
||||||
|
LOG_APPEND(TimedLog::LOG_INFO, "- player %s rest in beds, %s rest in the wilderness, %s wait",
|
||||||
|
player->bedRestAllowed ? "can" : "cannot", player->wildernessRestAllowed ? "can" : "cannot",
|
||||||
|
player->waitAllowed ? "can" : "cannot");
|
||||||
|
|
||||||
if (MWBase::Environment::get().getWindowManager()->isGuiMode())
|
if (MWBase::Environment::get().getWindowManager()->isGuiMode())
|
||||||
{
|
{
|
||||||
|
|
|
@ -76,7 +76,10 @@ namespace MWScript
|
||||||
if (!mwmp::Main::get().getLocalPlayer()->bedRestAllowed)
|
if (!mwmp::Main::get().getLocalPlayer()->bedRestAllowed)
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox("You are not allowed to rest in beds.");
|
MWBase::Environment::get().getWindowManager()->messageBox("You are not allowed to rest in beds.");
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
mwmp::Main::get().getLocalPlayer()->isUsingBed = true;
|
||||||
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Rest, bed);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Rest, bed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
End of tes3mp change (minor)
|
End of tes3mp change (minor)
|
||||||
|
|
Loading…
Reference in a new issue