summaryrefslogtreecommitdiff
path: root/src-03_allow-bio-firestarter-on-smoker.patch
blob: 52107270b09b3c650d831f1f2ccc8a72f2f4e1bf (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
--- a/src/iexamine.cpp
+++ b/src/iexamine.cpp
@@ -2476,7 +2476,10 @@
         return;
     }
 
-    if( !p.has_charges( itype_fire, 1 ) ) {
+    const bool has_bionic_firestarter = p.has_bionic( bio_lighter ) &&
+                                        p.enough_power_for( bio_lighter );
+
+    if( !has_bionic_firestarter && !p.has_charges( itype_fire, 1 ) ) {
         add_msg( _( "This kiln is ready to be fired, but you have no fire source." ) );
         return;
     } else {
@@ -4950,10 +4953,21 @@
         return;
     }
 
-    p.use_charges( itype_fire, 1 );
-    for( auto &it : here.i_at( examp ) ) {
-        if( it->has_flag( flag_SMOKABLE ) ) {
-            it->set_flag( flag_PROCESSING );
+    const bool has_bionic_firestarter = p.has_bionic( bio_lighter ) &&
+                                        p.enough_power_for( bio_lighter );
+
+    if( has_bionic_firestarter ) {
+        for( auto &it : here.i_at( examp ) ) {
+            if( it->has_flag( flag_SMOKABLE ) ) {
+                it->set_flag( flag_PROCESSING );
+            }
+        }
+    } else {
+        p.use_charges( itype_fire, 1 );
+        for( auto &it : here.i_at( examp ) ) {
+            if( it->has_flag( flag_SMOKABLE ) ) {
+                it->set_flag( flag_PROCESSING );
+            }
         }
     }
     here.furn_set( examp, next_smoker_type );