Cursed Upgradable Buildings

by L0771

* Blood handling * Upgradable buildings: - Mining drill - Assembling Machine - Furnace - Lab - Fisher - Turret - Wall - Energy Generator - Headquarter * New mecanics * Auto attack base * Auto attack base

Overhaul
3 years ago
0.16 - 1.1
908

b Crash with arrow lvl 1440

5 years ago

In control.lua:
...
script.on_event(defines.events.on_player_main_inventory_changed, function(event)
...
player.insert({name="cursed-arrow-"..stats.range.level,count=cant})

You forgot to check the maximum arrow level, like you have done in:

script.on_event(defines.events.on_player_ammo_inventory_changed, function(event)
...
local item_name = "cursed-arrow-" .. math.min(global.cursed[player.name].stats.range.level, datos.maxRange)

Also... cant is a really bad variable name there... just use "c" if you don't want to use count. "cant" sounds like you're checking some kind of (in)capability. :)

5 years ago

Sorry, the code is 10% Spanish, "cant" of "cantidad", instinctively code in English, but I'm very bad at talking it... Depends mostly on the sleep i had when you programmed it.

You´re right, thanks for the report.

5 years ago

Ahaa ok, I thought it was "cant" because it sounds similar to "count"... :)

New response