summaryrefslogtreecommitdiff
path: root/src-06_stop-sleeping-on-tables.patch
blob: eb3dc41d4cbdf1b4094368e23a386bafa63f58a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
--- a/src/character_functions.cpp
+++ b/src/character_functions.cpp
@@ -215,20 +215,24 @@
             }
         }
         // Not in a vehicle, start checking furniture/terrain/traps at this point in decreasing order
-        else if( furn_at_pos != f_null ) {
+        else if( furn_at_pos != f_null &&  furn_at_pos.obj().comfort >= 5 ) {
             comfort += 0 + furn_at_pos.obj().comfort;
         }
         // Web sleepers can use their webs if better furniture isn't available
         else if( websleep && web >= 3 ) {
             comfort += 1 + static_cast<int>( comfort_level::slightly_comfortable );
+        } else if( furn_at_pos != f_null &&  furn_at_pos.obj().comfort >= 4 ) {
+            comfort += 0 + furn_at_pos.obj().comfort;
+        } else if( !trap_at_pos.is_null() ) {
+            comfort += 0 + trap_at_pos.comfort;
         } else if( ter_at_pos == t_improvised_shelter ) {
             comfort += 0 + static_cast<int>( comfort_level::slightly_comfortable );
-        } else if( ter_at_pos == t_floor || ter_at_pos == t_floor_waxed ||
+        } else if( furn_at_pos != f_null &&  furn_at_pos.obj().comfort >= 1 ) {
+            comfort += 0 + furn_at_pos.obj().comfort;
+        } else if( ter_at_pos == t_carpet_concrete || ter_at_pos == t_carpet_metal ||
                    ter_at_pos == t_carpet_red || ter_at_pos == t_carpet_yellow ||
                    ter_at_pos == t_carpet_green || ter_at_pos == t_carpet_purple ) {
             comfort += 1 + static_cast<int>( comfort_level::neutral );
-        } else if( !trap_at_pos.is_null() ) {
-            comfort += 0 + trap_at_pos.comfort;
         } else {
             // Not a comfortable sleeping spot
             comfort -= here.move_cost( p );
--- a/src/mapdata.h
+++ b/src/mapdata.h
@@ -407,7 +407,7 @@
        t_thconc_floor, t_thconc_floor_olight, t_strconc_floor,
        t_floor, t_floor_waxed,
        t_dirtfloor,//Dirt floor(Has roof)
-       t_carpet_red, t_carpet_yellow, t_carpet_purple, t_carpet_green,
+       t_carpet_red, t_carpet_yellow, t_carpet_purple, t_carpet_green, t_carpet_concrete, t_carpet_metal,
        t_grate,
        t_slime,
        t_bridge,
--- a/src/mapdata.cpp
+++ b/src/mapdata.cpp
@@ -490,7 +490,7 @@
        t_thconc_floor, t_thconc_floor_olight, t_strconc_floor,
        t_floor, t_floor_waxed,
        t_dirtfloor,//Dirt floor(Has roof)
-       t_carpet_red, t_carpet_yellow, t_carpet_purple, t_carpet_green,
+       t_carpet_red, t_carpet_yellow, t_carpet_purple, t_carpet_green, t_carpet_concrete, t_carpet_metal,
        t_linoleum_white, t_linoleum_gray,
        t_grate,
        t_slime,