Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upHibernation-info #4961
Conversation
kevingranade
reviewed
Dec 9, 2013
| @@ -6612,6 +6613,15 @@ bool player::eat(game *g, item *eaten, it_comest *comest) | |||
| !query_yn(_("You're full. Force yourself to eat?"))) { | |||
| return false; | |||
| } | |||
| if (hiberfood && !is_npc() && (((hunger - (comest->nutr)) < -60) || ((thirst - (comest->quench)) < -60))){ | |||
This comment has been minimized.
This comment has been minimized.
kevingranade
Dec 9, 2013
Member
Did this actually work? I tried it like this and it wouldn't work correctly until I made a temp variable to hold hunger - 60, which is also evidently what happened down around line 6658.
Also the logic that seems like what we want is (hunger > -60 && thirst > -60) && (hunger - nutrition < -60 || thirst - quench < -60).
This comment has been minimized.
This comment has been minimized.
KA101
Dec 9, 2013
Author
Contributor
Seemed to when testing with hunger, but looks like the thirst-check either doesn't fire right or the char starts with negative Thirst. Will fix. Good catch.
This comment has been minimized.
This comment has been minimized.
|
So is it properly recording events to your memorial file now? |
This comment has been minimized.
This comment has been minimized.
|
Now that I found it, yeah. |
This comment has been minimized.
This comment has been minimized.
|
Each time I try hibernating it starts sleeping like normal but after a few moments the program freezes. |
This comment has been minimized.
This comment has been minimized.
|
Came through fine here. Do you alt-tab often? That game me a lag burst when I was testing. ??? |
This comment has been minimized.
This comment has been minimized.
|
It seems that usually the game will become responsive again after a few minutes. But even still, the massive nonresponsive lag chunk might make people think it's completely hung up. I know I did. |
This comment has been minimized.
This comment has been minimized.
|
OK, testing-procedure differential found the culprit. I'd tested underground and it runs like greased skis. Slept aboveground: sssllllooooowwwwww. Weather and critter-movement, I suspect, and it went nonresponsive in Day 3--as soon as I alt-tabbed over to check here. So maybe I won't implement hibernation for Plants. Apart from that, I'm not sure how best to handle people hibernating aboveground with in-game open windows and multitasking. Maybe disable vision and sound checks? Good catch, in any event. |
KA101 commentedDec 9, 2013
Adds a specific safety-check on entering the Hibernation part of the food meter and provided a quick hint as to the general idea. Thanks for the merge-cleanup and the guidance, Kevin. Much appreciated.
Memlog's working now. Mergers, feel free.