Project

General

Profile

Bug #3788

GetPCInJail and GetPCTraveling do not work as in vanilla

Added by Aaron Paden 9 months ago. Updated 23 days ago.

Status:
Confirmed
Priority:
Normal
Assignee:
-
Category:
Scripting
Target version:
Start date:
03/13/2017
% Done:

0%

Reproducibility:
Always
Operating system:
Other
Severity:
Normal

Description

I'm opening this bug on behalf of dabeowul1 from IRC, who didn't have an account for the bug tracker or github. According to dabeowul, some survival mods don't work because of an issue with getPCInJail.

Currently if you play a mod like Necessities of Morrowind for purists (or some eat/drink/sleep mod which says it can cope with jailtime) you will find yourself die from starvation/sleep deprivation/dehydration whatever as soon as jailtime ends because the time advancement happens while getPCInJail indicates you are not still in jail.

I think the only actually needed change is the one where "MWBase::Environment::get().getWorld()->advanceTime(mDays * 24);" is called. If anyone brings in to their attention I'd be happy. Maybe also the place where "MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Jail);" is executed. From that pastebin, everything else I attempted to fix it which is still in that diff there should be irrelevant.

Here is the pastebin dabeowul referenced: http://pastebin.com/raw/uKSrPdiB

History

#1 Updated by Mitchell Schwitzer 9 months ago

I'll look into and test this.

#2 Updated by Mitchell Schwitzer 9 months ago

I am unable to reproduce this. Going to jail with either mod active does not result in me dying once I have served my time.

#3 Updated by Paul McElroy 9 months ago

How long did you serve? Ensure you're spending adequate time in jail so that you would absolutely die.

#4 Updated by Andrei Kortunov 9 months ago

I can confirm this bug. Also GetPCTraveling is affected.

#5 Updated by Mitchell Schwitzer 9 months ago

Paul McElroy wrote:

How long did you serve? Ensure you're spending adequate time in jail so that you would absolutely die.

I had spent around 25-30 days in prison. I'll attempt it with larger bounty amounts. I had an issue where I was being marked for death as opposed to being able to choose to go to prison.

#6 Updated by Andrei Kortunov 8 months ago

It seems engine sets getPCInJail = 0 immediately after onJailFinished(). We should keep getPCInJail = 1 until a frame (first after leaving a jail) ends to make getPCInJail work properly.

GetPCTraveling is actually a stub that always terurns 0.

#7 Updated by Andrei Kortunov 4 months ago

  • Subject changed from getPCInJail does not work as in vanilla to GetPCInJail and GetPCTraveling do not work as in vanilla
  • Status changed from New to Confirmed

#8 Updated by Lennart Bernhardt 4 months ago

This bug seems to be fixed, on windows at least

#9 Updated by Lennart Bernhardt 4 months ago

Here's an album confirming this in reversed order

#10 Updated by Andrei Kortunov 4 months ago

  • Reproducibility changed from Have not tried to Sometimes

This bug seems to be fixed

GetPCTraveling is still a stub, IIRC. GetPCInJail work is unstable for me.

#11 Updated by Lennart Bernhardt 4 months ago

Ah sorry forgot to link the album https://vgy.me/a/qomtFpW4
I will look into GetPCTraveling

#13 Updated by Lennart Bernhardt 4 months ago

After writing some research for vanilla morrowind it seems that scripts are executed between the player clicking the travel button and the game starting to load the new cell.
Also GetPCTraveling seems to be true until like a frame after arriving.

Openmw does no currently support scripts running while traveling - anyone got any ideas to work around that?

#14 Updated by Alexei Dobrohotov 3 months ago

  • Category set to Scripting

#15 Updated by Alexei Dobrohotov 23 days ago

  • Target version set to openmw-1.0
  • Reproducibility changed from Sometimes to Always
  • Operating system changed from Linux to Other

Also available in: Atom PDF