Skip to content

Commit

Permalink
Fix compatibility issue with flamethrower ammo setting. (#141)
Browse files Browse the repository at this point in the history
* Fix compatibility issue with flamethrower ammo setting.

Fixes a compatibility issue with certain other mods, such as AAI Flame Tank and Flame Tumbler, which alter flamethrower ammo to consolidate the two source_types ("default" and "vehicle") down to a single universal type, causing a crash when the "vehicle flamethrower starts fires" setting tries to modify the second source_type.

* Updating changelog

---------

Co-authored-by: KiwiHawk <[email protected]>
  • Loading branch information
Qatavin and KiwiHawk authored Nov 12, 2023
1 parent b76d0a5 commit 1285c6a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
1 change: 1 addition & 0 deletions bobwarfare/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Date: ???
Bugfixes:
- Fixed Artillery Wagon Item Subgroup #110
- Fixed graphical gap between gates and reinforced walls #130
- Fixed crash related to setting Vehicle flamethrower starts fires #141
Changes:
- Added missing prerequisites #120
- Adjust tank recipe #129
Expand Down
30 changes: 29 additions & 1 deletion bobwarfare/data-updates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,33 @@ end
table.insert(data.raw.car.tank.resistances, { type = "plasma", decrease = 15, percent = 50 })

if settings.startup["bobmods-warfare-vehicleflamethrowerstartsfires"].value == true then
data.raw.ammo["flamethrower-ammo"].ammo_type[2].action.action_delivery.stream = "flamethrower-fire-stream"
data.raw.ammo["flamethrower-ammo"].ammo_type = {
{
category = "flamethrower",
clamp_position = true,
source_type = "default",
target_type = "position",
action = {
type = "direct",
action_delivery = {
type = "stream",
stream = "handheld-flamethrower-fire-stream"
}
}
},
{
category = "flamethrower",
clamp_position = true,
source_type = "vehicle",
target_type = "position",
consumption_modifier = 1.125,
action = {
type = "direct",
action_delivery = {
type = "stream",
stream = "flamethrower-fire-stream"
}
}
}
}
end

0 comments on commit 1285c6a

Please sign in to comment.