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

Electric fire starter can't start oil lamp #21005

Closed
Xpyder opened this issue May 12, 2017 · 11 comments

Comments

Projects
None yet
6 participants
@Xpyder
Copy link
Contributor

commented May 12, 2017

You can't light an oil lamp while holding an electric fire starter, without lighting something else first.

@Leland

This comment has been minimized.

Copy link
Contributor

commented May 12, 2017

Oil lamps don't require a fire source to be lit – they're activated.

@Leland

This comment has been minimized.

Copy link
Contributor

commented May 12, 2017

Spoke too soon! You do need a fire source. Can confirm this. And can also say that regular lighters do work.

@Leland

This comment has been minimized.

Copy link
Contributor

commented May 13, 2017

Oh my god you guys, we just have a giant if/else set for a list of things that can produce fire.

Cataclysm-DDA/src/player.cpp

Lines 6651 to 6702 in 54f5d76

bool player::has_fire(const int quantity) const
{
// TODO: Replace this with a "tool produces fire" flag.
if( g->m.has_nearby_fire( pos() ) ) {
return true;
} else if (has_charges("torch_lit", 1)) {
return true;
} else if (has_charges("battletorch_lit", quantity)) {
return true;
} else if (has_charges("handflare_lit", 1)) {
return true;
} else if (has_charges("candle_lit", 1)) {
return true;
} else if (has_charges("ref_lighter", quantity)) {
return true;
} else if (has_charges("matches", quantity)) {
return true;
} else if (has_charges("lighter", quantity)) {
return true;
} else if (has_charges("flamethrower", quantity)) {
return true;
} else if (has_charges("flamethrower_simple", quantity)) {
return true;
} else if (has_charges("hotplate", quantity)) {
return true;
} else if (has_charges("welder", quantity)) {
return true;
} else if (has_charges("welder_crude", quantity)) {
return true;
} else if (has_charges("shishkebab_on", quantity)) {
return true;
} else if (has_charges("firemachete_on", quantity)) {
return true;
} else if (has_charges("broadfire_on", quantity)) {
return true;
} else if (has_charges("firekatana_on", quantity)) {
return true;
} else if (has_charges("zweifire_on", quantity)) {
return true;
} else if (has_active_bionic("bio_tools") && power_level > quantity * 5 ) {
return true;
} else if (has_bionic("bio_lighter") && power_level > quantity * 5 ) {
return true;
} else if (has_bionic("bio_laser") && power_level > quantity * 5 ) {
return true;
} else if( is_npc() ) {
// A hack to make NPCs use their molotovs
return true;
}
return false;
}

So, hotfix would be to just add in crude_firestarter to that list. But we have a whole bunch of flags now that we should be able to use to check – I'll see what I can do.

Edit: this one's way beyond me

@DangerNoodle

This comment has been minimized.

Copy link
Contributor

commented May 13, 2017

I was about to say, were you thinking of oil lamp cookers?

@Xpyder

This comment has been minimized.

Copy link
Contributor Author

commented May 16, 2017

@DangerNoodle Nope, I mean an actual oil lamp (the thing you probably just immediately use as a part to make a cooker)

@DangerNoodle

This comment has been minimized.

Copy link
Contributor

commented May 16, 2017

I was asking @Leland that, actually.

@Treah

This comment has been minimized.

Copy link
Contributor

commented May 16, 2017

I don't think you wanna use add crude_firestarter to that as that would include the firedrills and camp fire drills which do not make an open flame and would not be practical for lighting a oil lamp with. Also I am unsure if you even want to add electric to this either as far as I am aware you really cant start a any type of oil lamp with them either. My understanding of the firestarter is just a coil of wire that heats up not a open flame. If that is the case then this is working as intended.

@Xpyder

This comment has been minimized.

Copy link
Contributor Author

commented May 17, 2017

While I could make a case for using the the ember you get from a fire drill being able to start an oil lamp, I think someone should double check the code used to check for cauterizing wounds and make sure it doesn't use "player::has_fire", unless we want the electric firestarter to count as enough heat to cauterize

@Treah

This comment has been minimized.

Copy link
Contributor

commented May 25, 2017

@Xpyder From what I gather in the code it only searches for things with flame. below is an excerpt of code.
This is in iuse_actor.cpp

1422 void cauterize_actor::load( JsonObject &obj )
1423 {
1424     assign( obj, "cost", cost );
1425     assign( obj, "flame", flame )
1426 }
@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor

commented May 26, 2017

ref_lighter_on = refillable lighter (lit) does not provide fire for cigarettes. You can check this in LUA console by this command:

game.add_msg(tostring(player:has_charges("fire",1)))
@pisskop

This comment has been minimized.

Copy link
Contributor

commented May 26, 2017

custom firestarters with reasonable movecosts also cannot activate items that require fire.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.