1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-24 03:47:58 +02:00

fix minor issue with rpg

This commit is contained in:
Gerkiz 2022-04-11 21:13:33 +02:00
parent 0f8ca8b84b
commit 9bf24f6659
2 changed files with 2173 additions and 2173 deletions

View File

@ -1197,9 +1197,9 @@ local function on_player_used_capsule(event)
force = force, force = force,
target_pos = target_pos, target_pos = target_pos,
range = range, range = range,
mana = rpg_t.mana,
tame_unit_effects = tame_unit_effects, tame_unit_effects = tame_unit_effects,
explosives = Explosives explosives = Explosives,
rpg_t = rpg_t
} }
object.callback(data) object.callback(data)

View File

@ -59,7 +59,7 @@ end
local function create_entity(data) local function create_entity(data)
local self = data.self local self = data.self
local player = data.player local player = data.player
local mana = data.mana local rpg_t = data.rpg_t
local position = data.position local position = data.position
local surface = data.surface local surface = data.surface
local force = data.force local force = data.force
@ -77,7 +77,7 @@ local function create_entity(data)
for y = 1, -1, -1 do for y = 1, -1, -1 do
local pos = {x = position.x + x, y = position.y + y} local pos = {x = position.x + x, y = position.y + y}
if surface.can_place_entity {name = self.entityName, position = pos} then if surface.can_place_entity {name = self.entityName, position = pos} then
if self.mana_cost > mana then if self.mana_cost > rpg_t.mana then
break break
end end
local e = surface.create_entity({name = self.entityName, position = pos, force = force}) local e = surface.create_entity({name = self.entityName, position = pos, force = force})