Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handyman Stuck forever (also happened with the Grim Reaper) #1329

Closed
lloyd-lejack opened this issue Jan 15, 2018 · 18 comments
Closed

Handyman Stuck forever (also happened with the Grim Reaper) #1329

lloyd-lejack opened this issue Jan 15, 2018 · 18 comments

Comments

@lloyd-lejack
Copy link

Hey LloydJara here! I was testing a custom map i made for the current version of CorsixTH (v0.61) and got a bug where a Handyman (and in a past save i currently don't have, the Death shortly before a patient died) got stuck forever on the hospital doing an action. Not sure if a similar ticket exists but i wanted to post this regardless.
I have no save prior to the bug, but i have the savegame when my Handyman got stuck forever while cleaning trash. The Death on the other hand, got stuck after letting the patient go to helll. Both him and his lava got stuck forever in the Hospital.

Here's the mentioned save:
https://dl.dropboxusercontent.com/s/renpn3vye1lagfz/Doctor%20Frog.sav?dl=0

My Operating System is Windows 10. Not sure if this behavior tends to happen on older versions.

https://prnt.sc/i0jcrv Here's also a pic showing the handyman.

Gamelog.txt

If im not wrong, this is the gamelog of the bug:

Created game with savegame version 122.
Error in timer handler:
C:\Program Files\CorsixTH\Lua\world.lua:2134: attempt to perform arithmetic on a nil value (local 'y')
stack traceback:
C:\Program Files\CorsixTH\Lua\world.lua:2134: in method 'removeObjectFromTile'
C:\Program Files\CorsixTH\Lua\objects\litter.lua:99: in method 'remove'
...gram Files\CorsixTH\Lua\humanoid_actions\sweep_floor.lua:45: in local 'timer_function'
C:\Program Files\CorsixTH\Lua\entity.lua:216: in field 'tick'
C:\Program Files\CorsixTH\Lua\entities\staff.lua:149: in method 'tick'
C:\Program Files\CorsixTH\Lua\world.lua:1051: in method 'onTick'
C:\Program Files\CorsixTH\Lua\app.lua:1008: in function <C:\Program Files\CorsixTH\Lua\app.lua:1005>
(...tail calls...)
C:\Program Files\CorsixTH\Lua\app.lua:909: in function <C:\Program Files\CorsixTH\Lua\app.lua:904>

@mugmuggy
Copy link
Contributor

Would be nice to see the save before the handyman issue as I worked a bit on improving that in 0.61.

For the stuck Reaper, that is a result of #1165 and fixed in latest master. Evidenced by the grims patient and the hospitals last emergency details - victims =5, cured = 3, killed = 4

@lloyd-lejack
Copy link
Author

Sadly i dont have the save right before the Handyman got suck. Not sure if i can replicate if perfectly but i could try.

@stavrossk
Copy link

Hi, is CorsixTH playable in it's current state?

Thanks,
Stavros.

@lloyd-lejack
Copy link
Author

lloyd-lejack commented Jan 17, 2018

It is, but im pretty sure the stuck handyman is still getting his salary paid (and even if i fire him, he would make space blocking any room to be build over him, which is annoying)
When this same problem happened with the Grim Reaper it got stuck on a vital spot, blocking me from building rooms there and.,. ironically, making me lose the scenario shortly after because i run out and space and i filled the Money losing condition.
I guess if this bug happens once again i'll try to keep the pre-save as well as the post-save.

@lloyd-lejack lloyd-lejack changed the title Handyman Stuck forever (also happened with "The Death") Handyman Stuck forever (also happened with the Grim Reaper) Jan 17, 2018
@wolfy1339
Copy link
Contributor

@stavrossk yes it completely is. It's stable and is very good

@psypod
Copy link

psypod commented Mar 6, 2018

This error can be reproduced by placing a bench on a tile while an handyman is trying to remove something from that tile (e.g. litter, vomit).

@TheCycoONE
Copy link
Member

Thanks @psypod

@psypod
Copy link

psypod commented Mar 8, 2018

A possible solution would be to comment out the line 2205 in world.lua. That would also prevent the abusive usage of objects to manually remove litter. It seems that handyman can clean the litter anyway (just tested).

Edit: Not sure about other side-effects.

@MarkL1961
Copy link
Contributor

If "prevent the abusive usage of objects to manually remove litter" refers to placing an object over litter to remove it that is intentional to replicate how TH allows objects to clean litter. Which comes in handy with vomit waves.

@psypod
Copy link

psypod commented Mar 8, 2018

Well that's no solution then. I rushed through the campaign on original TH last week and didn't came across that possibility so i thought it's an issue.

@ghost
Copy link

ghost commented May 23, 2018

With the grim reaper stuck it's a more serious problem, because when he's spawned again for another dead patient, the game crashes without any output whatsoever. Until a fix is found, people who want to play without this bug can find Lua/humanoid_actions/die.lua in the CorsixTH folder, and replace

  -- Bloaty head patients can't go to hell because they don't have a
  -- "transform to standard male"/"fall into lava hole" animation.
  if humanoid:isMalePatient() and humanoid.disease.id ~= "bloaty_head" then
    if math.random(1, 100) <= 65 then
      humanoid:setTimer(fall_anim_duration, action_die_tick_reaper)
    else
      humanoid:setTimer(fall_anim_duration, action_die_tick)
    end
  else
    humanoid:setTimer(fall_anim_duration, action_die_tick)
  end

with just

humanoid:setTimer(fall_anim_duration, action_die_tick)

which will permanently disable the grim reaper.

@ElvarT
Copy link

ElvarT commented Jul 18, 2018

Regarding the handyman crashes. I have also seen them happening a couple of times. If you would be interested, this is a savegame just a couple of seconds before one of them:
https://nofile.io/f/CPpw3vms82f/before+crash.sav.7z
This was the log:

Created game with savegame version 122.
Warning: Trying to remove nonexistant room build callback (function: 0x55d2e110e780) from humanoid (table: 0x55d2c4609100).
Warning: Trying to remove nonexistant room remove callback (function: 0x55d2c5f126f0) from humanoid (table: 0x55d2c4609100).
Savegame version is 122 (v0.61), originally it was 122 (v0.61)
Warning: Trying to remove nonexistant room build callback (function: 0x5570abeafcb0) from humanoid (table: 0x5570505a61f0).
Warning: Trying to remove nonexistant room remove callback (function: 0x5570abeb7d70) from humanoid (table: 0x5570505a61f0).
Warning: Trying to remove nonexistant room build callback (function: 0x557068843e40) from humanoid (table: 0x5570510a6290).
Warning: Trying to remove nonexistant room remove callback (function: 0x557068843e10) from humanoid (table: 0x5570510a6290).
Warning: Trying to remove nonexistant room build callback (function: 0x55715ff9ee30) from humanoid (table: 0x55704ef0ed50).
Warning: Trying to remove nonexistant room remove callback (function: 0x55704e6e32a0) from humanoid (table: 0x55704ef0ed50).
Warning: Trying to remove nonexistant room build callback (function: 0x557160b85b30) from humanoid (table: 0x55704fa59d80).
Warning: Trying to remove nonexistant room remove callback (function: 0x55705114c320) from humanoid (table: 0x55704fa59d80).
Warning: Trying to remove nonexistant room build callback (function: 0x5570abece300) from humanoid (table: 0x55714d34f420).
Warning: Trying to remove nonexistant room remove callback (function: 0x55704eb36b70) from humanoid (table: 0x55714d34f420).
Warning: Trying to remove nonexistant room build callback (function: 0x55705031da70) from humanoid (table: 0x55704e97a540).
Warning: Trying to remove nonexistant room remove callback (function: 0x557067068fe0) from humanoid (table: 0x55704e97a540).
Warning: Trying to remove nonexistant room build callback (function: 0x55704f761440) from humanoid (table: 0x5570688a5450).
Warning: Trying to remove nonexistant room remove callback (function: 0x5570af76bc50) from humanoid (table: 0x5570688a5450).
Warning: Trying to remove nonexistant room build callback (function: 0x5571628a33a0) from humanoid (table: 0x5570688a5450).
Warning: Trying to remove nonexistant room remove callback (function: 0x55704f64a650) from humanoid (table: 0x5570688a5450).
Savegame version is 122 (v0.61), originally it was 122 (v0.61)
Warning: Trying to remove nonexistant room build callback (function: 0x5625f606f960) from humanoid (table: 0x5625df748850).
Warning: Trying to remove nonexistant room remove callback (function: 0x5625e11f06b0) from humanoid (table: 0x5625df748850).
Savegame version is 122 (v0.61), originally it was 122 (v0.61)
Savegame version is 122 (v0.61), originally it was 122 (v0.61)
Savegame version is 122 (v0.61), originally it was 122 (v0.61)
Savegame version is 122 (v0.61), originally it was 122 (v0.61)
Savegame version is 122 (v0.61), originally it was 122 (v0.61)
Savegame version is 122 (v0.61), originally it was 122 (v0.61)
Error in timer handler: 
./Lua/room.lua:316: Handyman arrived is on call but not arriving to the designated room
stack traceback:
	[C]: in function 'assert'
	./Lua/room.lua:316: in function 'onHumanoidEnter'
	./Lua/humanoid_actions/walk.lua:383: in function 'on_next_tile_set'
	./Lua/humanoid_actions/walk.lua:232: in function <./Lua/humanoid_actions/walk.lua:178>
	(...tail calls...)
	./Lua/entity.lua:216: in function 'tick'
	./Lua/entities/staff.lua:149: in function 'tick'
	./Lua/world.lua:1051: in function 'onTick'
	./Lua/app.lua:1008: in function <./Lua/app.lua:1005>
	(...tail calls...)
	./Lua/app.lua:909: in function <./Lua/app.lua:904>

Thank you very much for creating and maintaining CorsixTH

@ElvarT
Copy link

ElvarT commented Jul 18, 2018

The crash case in that savegame seems to have a few things to it: If you pick the handyman who is going to crash, the next handyman (which claims to be heading for the slicer) will a few seconds later go for the same pharmacy plant and cause the same crash.
Even more confusingly, if I reply and take both of those handymen out of the way, edit the pharmacy to remove the plant, a couple of minutes later another (or the same?) handyman will enter the room to water the now nonexistant plant, and cause the crash :).
Seems that pharmacy is a magnet for confusing handymen.

It would seem that this crash would be related to the handyman trying to go to repair the slicer next door, but landing on the pharmacy instead. While the slicer is in good repair the problem disappears. But if the slicer needs a handyman (even 1 hour later in that same game run the handyman will go to the pharmacy and cause the same crash).

@TheCycoONE
Copy link
Member

TheCycoONE commented Jul 18, 2018

Thank you @ElvarT. Your issue is interesting because it is not litter.

@mugmuggy
Copy link
Contributor

mugmuggy commented Jul 19, 2018

Existing issue the handyman arriving in the wrong room see #624.

I commented a little before with a different explanation but alas, taken a look and can see the slicers handyman position appears to be -1,1 pushing that tile into the pharmacy. Appears to be some sort of problem with the orientations handyman position not updating when orientations are changed.

@TheCycoONE
Copy link
Member

You are right @mugmuggy. @ElvarT let's move discussion of your issue to #624

@lewri
Copy link
Member

lewri commented Aug 5, 2020

I can't replicate the handyman and litter problem using the method mentioned by @psypod
But we do get this now, so I assume something's happened to the code since:

Warning: Removing litter that has already been removed.
Warning: Removing litter that has already been removed.
Warning: Removing litter that has already been removed.
Warning: Removing litter that has already been removed.
Warning: Removing litter that has already been removed.
Warning: Trying to remove nonexistent room build callback (function: 000001AF2FD89F80) from humanoid (table: 000001AF2D999270).
Warning: Trying to remove nonexistent room remove callback (function: 000001AF2E5568C0) from humanoid (table: 000001AF2D999270).
Warning: Trying to remove nonexistent staff callback (function: 000001AF2FD8ADF0) from humanoid (table: 000001AF2D999270).
Warning: Removing litter that has already been removed.
Warning: Removing litter that has already been removed.

@lewri
Copy link
Member

lewri commented Feb 12, 2024

This is fixed now as far as I can tell.

The warning still happens Removing litter that has already been removed if you place a bench while the handyman is cleaning but that is not what this issue is about.

Grim reaper also seems fine now .

@lewri lewri closed this as completed Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants