Smoke from fire - bug?

Issues with the campaign environment

Moderator: Moderators

Post Reply
obese pigeon
Posts: 951
Joined: Sat Mar 19, 2011 10:51 am

Smoke from fire - bug?

Post by obese pigeon »

The smoke started after fire spread from the heavy woods to the building:
Image


A few woods are on fire now, but it seems like only the burning building is generating smoke:
Image

Vector
Posts: 46
Joined: Thu Jun 14, 2018 8:19 pm

Re: Smoke from fire - bug?

Post by Vector »

Yeah I vaguely remember this bug as a reason we haven't used the fire without smoke setup before; it doesn't prevent buildings from generating smoke.

TigerShark
Mekwars Server Operator
Posts: 736
Joined: Wed Feb 24, 2010 8:28 am

Re: Smoke from fire - bug?

Post by TigerShark »

Yeah, this happened in one of my games as well. I feel like it's a simple fix in the code, but I haven't looked into it yet.

obese pigeon
Posts: 951
Joined: Sat Mar 19, 2011 10:51 am

Re: Smoke from fire - bug?

Post by obese pigeon »

Once the woods burns down to rough terrain, it then generates smoke as well.

Seems like the code only prevents smoke from wood fires, but not fires from other terrain types

Image


Edit: Should this be better posted under megamek bugs? If so, can a mod or admin kindly move it there?

TigerShark
Mekwars Server Operator
Posts: 736
Joined: Wed Feb 24, 2010 8:28 am

Re: Smoke from fire - bug?

Post by TigerShark »

EDIT: Nope, that didn't work.

TigerShark
Mekwars Server Operator
Posts: 736
Joined: Wed Feb 24, 2010 8:28 am

Re: Smoke from fire - bug?

Post by TigerShark »

I can fix the "buildings create smoke" feature easily (found where the code is), but someone will need to compile the change.

TigerShark
Mekwars Server Operator
Posts: 736
Joined: Wed Feb 24, 2010 8:28 am

Re: Smoke from fire - bug?

Post by TigerShark »

Fix for the buildings burning/producing smoke:

Code: Select all

src\megamek\server\FireHandler.java
Delete text in red.
// Add smoke, unless tornado or optional rules
boolean containsForest = (currentHex.containsTerrain(Terrains.WOODS)
|| currentHex.containsTerrain(Terrains.JUNGLE));
boolean bInferno = currentHex.terrainLevel(Terrains.FIRE) == 2;
if ((game.getPlanetaryConditions().getWindStrength() < PlanetaryConditions.WI_TORNADO_F13)
&& !(game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_FOREST_FIRES_NO_SMOKE)
&& containsForest && (bldg == null))) {
ArrayList<Coords> smokeList = new ArrayList<>();

Vector
Posts: 46
Joined: Thu Jun 14, 2018 8:19 pm

Re: Smoke from fire - bug?

Post by Vector »

TigerShark wrote:
Mon Dec 27, 2021 4:23 am
Fix for the buildings burning/producing smoke:

Code: Select all

src\megamek\server\FireHandler.java
Delete text in red.
// Add smoke, unless tornado or optional rules
boolean containsForest = (currentHex.containsTerrain(Terrains.WOODS)
|| currentHex.containsTerrain(Terrains.JUNGLE));
boolean bInferno = currentHex.terrainLevel(Terrains.FIRE) == 2;
if ((game.getPlanetaryConditions().getWindStrength() < PlanetaryConditions.WI_TORNADO_F13)
&& !(game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_FOREST_FIRES_NO_SMOKE)
&& containsForest && (bldg == null))) {
ArrayList<Coords> smokeList = new ArrayList<>();
I think you need to delete "&& containsForest" as well, because otherwise the optional rule will only matter when "containsForest" is true.
Last edited by Vector on Sat Jan 15, 2022 1:05 am, edited 1 time in total.

TigerShark
Mekwars Server Operator
Posts: 736
Joined: Wed Feb 24, 2010 8:28 am

Re: Smoke from fire - bug?

Post by TigerShark »

I've tested it both ways after the elimination of the building portion of the code and found no smoke either way.

Post Reply