Issue 794 in corsix-th: Game crash when a room about to be entered is removed

11 views
Skip to first unread message

cors...@googlecode.com

unread,
Mar 29, 2011, 5:19:51 PM3/29/11
to corsix-t...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 794 by sr.ribe...@gmail.com: Game crash when a room about to be
entered is removed
http://code.google.com/p/corsix-th/issues/detail?id=794

When there are patients on the way to use a toilet room (Toilets) and the
player is completely removes it the game crashes and isn't able to recover
from the error.

This has happened on levels three and four so far.

Best regards,

Version: Beta 6 (Linux 32-bit Debian package)
OS: Ubuntu 10.10

cors...@googlecode.com

unread,
Apr 1, 2011, 4:00:29 PM4/1/11
to corsix-t...@googlegroups.com
Updates:
Status: Accepted

Comment #1 on issue 794 by cgja...@gmail.com: Game crash when a room about

Confirmed, a simple case is to create a GP and staff room. If you delete
the GP after the doctor gets off the couch and heads back to his office,
it'll crash because of an empty action queue once he arrives at the space
where the door used to be.

cors...@googlecode.com

unread,
Apr 1, 2011, 4:04:02 PM4/1/11
to corsix-t...@googlegroups.com

Comment #2 on issue 794 by cgja...@gmail.com: Game crash when a room about

Remove the room before the GP gets to it in the following save to reproduce.

Attachments:
removeroomcrash.sav 217 KB

cors...@googlecode.com

unread,
Apr 1, 2011, 4:25:42 PM4/1/11
to corsix-t...@googlegroups.com

Comment #3 on issue 794 by edvin.li...@gmail.com: Game crash when a room

There is a function called "deactivate" which is called when a room is
deleted in room.lua. It should (does not at the moment) reroute patients
and any staff going there which haven't been specifically called.

cors...@googlecode.com

unread,
Apr 2, 2011, 4:37:03 PM4/2/11
to corsix-t...@googlegroups.com

Comment #4 on issue 794 by cgja...@gmail.com: Game crash when a room about

So, we could solve this problem by getting the EntranceXY of the room and
finding all humanoids walking to that co-ordinate and tell them to do
something else. This could be computationally expensive in large hospitals
but it wouldn't be called very often. But I'm not sure how you'd get the
set of humanoids who are walking somewhere.
The root cause of the problem is that when people are sent to a room they
are just instructed to walk to the tile inside the door. This doesn't tie
them to the room at all so when deactivate is called they're not included.
If instead, when humanoids are sent to a room they are instructed to use
the door, then when deactivate is called all the humanoids with actions
tied to the door will get rerouted.
I'm not very familiar with the action code so I'm not sure how this should
be implemented.

cors...@googlecode.com

unread,
Apr 2, 2011, 5:07:07 PM4/2/11
to corsix-t...@googlegroups.com

Comment #5 on issue 794 by edvin.li...@gmail.com: Game crash when a room

The thing is that this was working fairly well before. I had logic for
exactly this kind of thing, with staff in a list
called "approaching_staff". But it may have been removed around the time
when the calls dispatcher was added or something, I don't know.

There was a period during the autumn when there was a new action system
(not just tables, "real" classes) being worked on (lies as a branch) but it
never got into trunk. That system would make such things possible. For
patients there is the rerouteAllPatients function. I suggest that a
callback/entry in a list is created in the createEnterAction function each
time a humanoid calls that function. The room holds all these
callbacks/list, and if something happens it can directly call them/traverse
the list.
The upside of callbacks is that the programmer can decide what to do
instead per humanoid (or at least class) without the room's concern. A list
on the other hand won't need special persistance care and may be a little
easier to implement. Both can be error prone though, one has to make sure
the list is up to date at all times.

cors...@googlecode.com

unread,
Apr 2, 2011, 8:23:22 PM4/2/11
to corsix-t...@googlegroups.com

Comment #6 on issue 794 by Grim...@gmail.com: Game crash when a room about

I think this issue is related:
https://code.google.com/p/corsix-th/issues/detail?id=690

cors...@googlecode.com

unread,
Aug 10, 2011, 3:50:37 AM8/10/11
to corsix-t...@googlegroups.com

Comment #7 on issue 794 by cgja...@gmail.com: Game crash when a room about

Issue 943 has been merged into this issue.

cors...@googlecode.com

unread,
Sep 6, 2011, 5:04:51 AM9/6/11
to corsix-t...@googlegroups.com
Updates:
Status: Started
Owner: cgja...@gmail.com

Comment #8 on issue 794 by cgja...@gmail.com: Game crash when a room about

(No comment was entered for this change.)

cors...@googlecode.com

unread,
Sep 26, 2011, 12:40:53 PM9/26/11
to corsix-t...@googlegroups.com

Comment #9 on issue 794 by cgja...@gmail.com: Game crash when a room about

Ok so this is a trickier problem than I original supposed. I have something
working but I need some input on what the proper behavior should be.

Let's give the scenario of a doctors office, a patient, and a doctor. The
office is empty, the patient knocks on the door and sits outside, the
doctor begins walking towards the office. Then, the player edits the
office. Now, what happens?

Is the room queue emptied? Do the patients look for another room? Or do
they wait for the room to be OK-ed and then knock again? Or is the queue
kept as is?

What should the doctor do? Do they wait for the edit OK/Delete to decide
whether they go back to the room or do find something else to do?

Right now, I have where editing a room will cause anyone heading to that
room to do something else instead and pretend as though the room does not
exist. The queue is kept as is but this means that a doctor will not head
back to a room in which he was earlier called by a patient until the NEXT
person knocks on the door, which is undesirable.

I tried playing around with this in TH'97 and I found a few bugs, so that
makes me feel a little better :)

cors...@googlecode.com

unread,
Sep 26, 2011, 12:51:34 PM9/26/11
to corsix-t...@googlegroups.com

Comment #10 on issue 794 by toasterb...@privatdemail.net: Game crash when a

I think staff and queue have to wait while the room is edited.
On confirming delete, staff is free to go elsewhere, queue too if a second
same
room/clinic is available. If not, a fax should pop up, saying that room is
missing
and option: wait or sendhome (third I can not remember from orig. TH)

Same problem is i.e.: In orig TH if you edit the research room, staff will
go out and
wait until edit is finished. In CTH researcher go out and maybe get called
to
some work.

cors...@googlecode.com

unread,
Sep 26, 2011, 2:19:31 PM9/26/11
to corsix-t...@googlegroups.com

Comment #11 on issue 794 by mark.l1...@hotmail.co.uk: Game crash when a

Okay, I can check all this as I can still use the original game. I will
answer each question in order.
The patients wait while you edit the room.
They don't knock again, as they have waited.
If he is needed elsewhere he goes there, if he is just wandering he will
come back (this all depends on how many staff you have)

I think the real problem is when you delete a room, if there is another the
patients will go there. If it was the only one, i.e. you buy a new plot
and start to move things around the patients will either decide to go home
or it throws an error. What should happen is that they wait to see if you
build it again, if others are sent to the room that has just gone you will
get a fax as if it is the first time that room was needed. If you don't
build the replacement fast enough the patients will get fed and leave "no
more diagnosis" etc


cors...@googlecode.com

unread,
Sep 27, 2011, 3:14:09 AM9/27/11
to corsix-t...@googlegroups.com

Comment #12 on issue 794 by toasterb...@privatdemail.net: Game crash when a

#11


"If he is needed elsewhere he goes there, if he is just wandering he will
come back (this all depends on how many staff you have)"

in my opinion this should only happen if the room is deleted. see research
room comment. i.e. if you play large maps, have a number of researchers and
your have to edit the room for adding computers aso, your researchers are
most times called to
another room, and then you have to pick em up and replace them in the
research room. not very comfortable. And, for other rooms, if a queue is
kept until editing, a doctor/nurse IS needed after editing, so freeing them
makes no sense.

btw, don't forget to handle the patients in "expected queue".

cors...@googlecode.com

unread,
Sep 27, 2011, 3:59:26 AM9/27/11
to corsix-t...@googlegroups.com

Comment #13 on issue 794 by mark.l1...@hotmail.co.uk: Game crash when a

@ 12

I am only reporting what occurs in TH, I have made no opinions on whether
this is good or bad, right or wrong. So in TH if you edit the room the
staff will go elsewhere if they are needed; this is a fact. I may have had
a different result if I had more staff, as this might have meant he was not
needed elsewhere!

cors...@googlecode.com

unread,
Sep 27, 2011, 5:33:50 PM9/27/11
to corsix-t...@googlegroups.com

Comment #14 on issue 794 by cgja...@gmail.com: Game crash when a room about

Thanks for the info guys. I'm going to implement it like the original TH
but it should be possible to make special cases on a per-room basis. So
it'd be possible to change the behavior for research rooms but that'll
probably be a separate patch.

cors...@googlecode.com

unread,
Jan 1, 2014, 2:56:53 PM1/1/14
to corsix-t...@googlegroups.com
Updates:
Status: Queued

Comment #16 on issue 794 by mark.l1...@hotmail.co.uk: Game crash when a
room about to be entered is removed
http://code.google.com/p/corsix-th/issues/detail?id=794

I think this issue has started to happen again. Edited the only scanner
room and the queue upped and left with the dynamic info saying "no more
diagnosis available".

If I had been editing the room for sometime this is expected, but it
happens straight away.

Version 0.30

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

cors...@googlecode.com

unread,
Jan 5, 2014, 2:11:50 PM1/5/14
to corsix-t...@googlegroups.com

Comment #17 on issue 794 by mark.l1...@hotmail.co.uk: Game crash when a
room about to be entered is removed
http://code.google.com/p/corsix-th/issues/detail?id=794

This issue seems to only affect diagnosis rooms, with treatment rooms if
you edit you do get the fax pop up and as soon as you have finished the
edit the fax message goes again.
Perhaps the fix here was never applied to diagnosis rooms?

cors...@googlecode.com

unread,
Jan 23, 2014, 3:26:26 PM1/23/14
to corsix-t...@googlegroups.com

Comment #18 on issue 794 by mark.l1...@hotmail.co.uk: Game crash when a
room about to be entered is removed
http://code.google.com/p/corsix-th/issues/detail?id=794

just edited the xray and that had a patient waiting, he however did wait
and the usual fax popped up. So perhaps it is handled correctly here too?

cors...@googlecode.com

unread,
Dec 24, 2014, 12:47:07 PM12/24/14
to corsix-t...@googlegroups.com
Updates:
Status: Done

Comment #19 on issue 794 by mark.l1...@hotmail.co.uk: Game crash when a
room about to be entered is removed
https://code.google.com/p/corsix-th/issues/detail?id=794

Transferred to our github account end of 2014

https://github.com/CorsixTH/CorsixTH
Reply all
Reply to author
Forward
0 new messages