CorsixTH / CorsixTH

Open source clone of Theme Hospital
Other
4k stars 360 forks source link

[Bug] Broken Walk action #1963

Open lewri opened 3 years ago

lewri commented 3 years ago

Describe the issue

Error reported when patient tries to use a door

Steps to Reproduce

  1. Load save game attached to this ticket

  2. Wait

Save Game

l12.zip

Expected Behavior

Don't crash, enter the door

System Information

CorsixTH Version: Appveyor 585 (after Jelly PR)

Operating System: e.g. Windows 10

Theme Hospital Version: CD, GOG.com, Origin, or Demo

Gamelog.txt

An error has occurred!
Almost anything can be the cause, but the detailed information below can help the developers find the source of the error.
Running: The timer handler.
A stack trace is included below, and the handler has been disconnected.
Lua\humanoid_actions\walk.lua:30: Invalid value for parameter 'x'
stack traceback:
        [C]: in function 'assert'
        Lua\humanoid_actions\walk.lua:30: in local 'constructor'
        Lua\class.lua:74: in global 'WalkAction'
        Lua\entities\humanoid.lua:684: in method 'walkTo'
        Lua\rooms\gp.lua:102: in method 'commandEnteringPatient'
        Lua\room.lua:401: in method 'onHumanoidEnter'
        Lua\humanoid_actions\walk.lua:383: in field 'on_next_tile_set'
        Lua\humanoid_actions\walk.lua:185: in function <Lua\humanoid_actions\walk.lua:172>
        (...tail calls...)
        Lua\entity.lua:216: in method 'tick'
        Lua\world.lua:1087: in method 'onTick'
        Lua\app.lua:1134: in function <Lua\app.lua:1131>
        (...tail calls...)
        Lua\app.lua:1034: in function <Lua\app.lua:1029>

Additional Info

Paste any screen shots or other additional information that might help illustrate the problem.

mugmuggy commented 3 years ago

No path to the chair, patient can't get to the chair and the doctor placed behind the desk near the chair also can't leave. #1667 sets a flag, but your config file might have literal 'nil' instead of false. This will be as, you haven't replaced your config file when switching between versions when the flag was added, thus had nothing to initiate and the tostring will put 'nil' in there. Easy trap.

lewri commented 3 years ago

Would it be better then to have fallbacks where the config file isn't locating something? Edit: Actually I think my config is from 0.65 beta 2 on my testing.

lewri commented 3 years ago

Either that or this is a potential +1 to keep checks inside rooms as per that pr

lewri commented 3 years ago

So the config.txt is inserting nil as the default value. That doesn't seem right.

-------------------------------------------------------------------------------------------------------------------------
-- If true, parts of the hospital can be made inaccessible by blocking the path
-- with rooms or objects. If false, all parts of the hospital must be kept
-- accessible, the game will disallow any attempt to blocking the path.
-- 
allow_blocking_off_areas = nil
TheCycoONE commented 3 years ago

No you're right, nil should uniformly use whatever the default value is for the config, and we don't have a mechanism for that yet. I'll open a new issue for that.

mugmuggy commented 2 years ago

I think my comment threw everyone off, and its not clear. Defaults are used if they are missing, the key issue is when switching between versions, the config being written can be different, and that the debug flag state isn't persisted in the save either but we only expect this circumstance in the blocked off areas scenario. Same as #2021.

dadv commented 1 year ago

saves.zip

dadv commented 1 year ago

I just had very similar problem. However, I just installed CorsixTH 0.66 for Windows 8.1 first time, no upgrades. I started new game first time, also. A patient got stuck entering psycho room and there is graphics glitch also: a door is drawn second time with small shift from original position. I tried to send the patient out of hospital but she stays still. She also stays still if I try to modify the room.

Attaching two saves, before and after the problem.

---------------------------------------------------------------

Welcome to CorsixTH v0.66!

---------------------------------------------------------------

This window will display useful information if an error occurs.

---------------------------------------------------------------

Checking for CorsixTH updates...
You are running the latest version of CorsixTH.
Taking screenshot: C:\Users\root\AppData\Roaming\CorsixTH\Screenshots\screenshot1.bmp
Warning: Entity tile changed while marked as using an object
An error has occurred!
Almost anything can be the cause, but the detailed information below can help the developers find the source of the error.
Running: The timer handler.
A stack trace is included below, and the handler has been disconnected.
Lua\humanoid_actions\walk.lua:30: Invalid value for parameter 'x'
stack traceback:
        [C]: in function 'assert'
        Lua\humanoid_actions\walk.lua:30: in local 'constructor'
        Lua\class.lua:74: in global 'WalkAction'
        Lua\entities\humanoid.lua:687: in method 'walkTo'
        Lua\rooms\psych.lua:132: in method 'commandEnteringPatient'
        Lua\room.lua:401: in method 'onHumanoidEnter'
        Lua\humanoid_actions\walk.lua:383: in field 'on_next_tile_set'
        Lua\humanoid_actions\walk.lua:185: in function <Lua\humanoid_actions\walk.lua:172>
        (...tail calls...)
        Lua\entity.lua:216: in method 'tick'
        Lua\world.lua:1085: in method 'onTick'
        Lua\app.lua:1130: in function <Lua\app.lua:1127>
        (...tail calls...)
        Lua\app.lua:1030: in function <Lua\app.lua:1025>

Warning: No event handler for timer