mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-20 20:09:41 +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()->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()->popGuiMode();
|
||||
|
|
|
@ -1300,9 +1300,14 @@ namespace MWInput
|
|||
Start of tes3mp addition
|
||||
|
||||
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())
|
||||
return;
|
||||
|
||||
mwmp::Main::get().getLocalPlayer()->isUsingBed = false;
|
||||
/*
|
||||
End of tes3mp addition
|
||||
*/
|
||||
|
|
|
@ -74,6 +74,7 @@ LocalPlayer::LocalPlayer()
|
|||
jailProgressText = "";
|
||||
jailEndText = "";
|
||||
|
||||
isUsingBed = false;
|
||||
isReceivingInventory = false;
|
||||
isReceivingQuickKeys = false;
|
||||
isPlayingAnimation = false;
|
||||
|
|
|
@ -18,6 +18,7 @@ namespace mwmp
|
|||
time_t deathTime;
|
||||
bool receivedCharacter;
|
||||
|
||||
bool isUsingBed;
|
||||
bool isReceivingInventory;
|
||||
bool isReceivingQuickKeys;
|
||||
bool isPlayingAnimation;
|
||||
|
|
|
@ -24,6 +24,9 @@ namespace mwmp
|
|||
if (isLocal())
|
||||
{
|
||||
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())
|
||||
{
|
||||
|
|
|
@ -76,7 +76,10 @@ namespace MWScript
|
|||
if (!mwmp::Main::get().getLocalPlayer()->bedRestAllowed)
|
||||
MWBase::Environment::get().getWindowManager()->messageBox("You are not allowed to rest in beds.");
|
||||
else
|
||||
{
|
||||
mwmp::Main::get().getLocalPlayer()->isUsingBed = true;
|
||||
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Rest, bed);
|
||||
}
|
||||
}
|
||||
/*
|
||||
End of tes3mp change (minor)
|
||||
|
|
Loading…
Reference in a new issue