1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-12 10:04:40 +02:00

Merge pull request #1175 from Refactorio/fix_coin_spill

Fixed coin pickup on entity death
This commit is contained in:
grilledham 2021-02-13 19:59:00 +00:00 committed by GitHub
commit 5d35e50e27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -447,6 +447,7 @@ local function do_coin_drop(entity_name, entity, cause)
if player and player.valid then
local coins = {name = "coin", count = count}
if player.can_insert(coins) then
player.insert(coins)
entity.surface.create_entity{name="flying-text", position = {position.x - 1, position.y}, text = "+" .. count .. " [img=item.coin]", color = {1, 0.8, 0, 0.5}, render_player_index = player.index}
return
end