Skip to content

Commit

Permalink
0.4.4 - Chargeless bots crash fix
Browse files Browse the repository at this point in the history
Fixes #2
  • Loading branch information
dustine committed Oct 8, 2017
1 parent d8fef13 commit 24bf78e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). Mostly.

## [Unreleased]

## [0.4.4] - 2017-10-08
### Fixed
- Chargeless robots workaround no longer crashes the game

## [0.4.3] - 2017-10-07
### Fixed
- Chargers are disassembled on pre_mined event now for mod compatibility
Expand Down Expand Up @@ -56,7 +60,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). Mostly.
- Custom overtaxing
- README as mod documentation

[Unreleased]: https://github.com/dustine/ChargeTransmission/compare/v0.4.3...HEAD
[Unreleased]: https://github.com/dustine/ChargeTransmission/compare/v0.4.4...HEAD
[0.4.4]: https://github.com/dustine/ChargeTransmission/compare/v0.4.3...v0.4.4
[0.4.3]: https://github.com/dustine/ChargeTransmission/compare/v0.4.2...v0.4.3
[0.4.2]: https://github.com/dustine/ChargeTransmission/compare/v0.4.1...v0.4.2
[0.4.1]: https://github.com/dustine/ChargeTransmission/compare/v0.4.0...v0.4.1
Expand Down
4 changes: 2 additions & 2 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,9 @@ script.on_event(defines.events.on_tick, function(event)
local bot
if bid <= #constrobots then bot = constrobots[bid]
else bot = logibots[bid - #constrobots] end
local max_energy = bot_max[bot.name] * modifier
local max_energy = (bot_max[bot.name] or 0) * modifier

if bot and max_energy and bot.valid and bot.energy < max_energy then
if bot and bot.valid and bot.energy < max_energy then
cost = cost + (max_energy - bot.energy) * 1.5
if cost < energy then
bot.energy = max_energy
Expand Down
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ChargeTransmission",
"version": "0.4.3",
"version": "0.4.4",
"title": "Charge Transmission",
"author": "Dustine",
"dependencies": ["base >= 0.15.34"],
Expand Down

0 comments on commit 24bf78e

Please sign in to comment.