mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-03-05 15:05:57 +02:00
Updated as per review suggestions
This commit is contained in:
parent
c9d8189218
commit
28bcd68786
@ -439,9 +439,10 @@ local function do_coin_drop(entity_name, entity, cause)
|
||||
|
||||
local count = random(bounds.low, bounds.high)
|
||||
if count > 0 then
|
||||
if cause.name == 'character' and cause.player.can_insert({name="coin", count = count}) then -- try put coins into inventory
|
||||
cause.player.insert{name="coin", count = count}
|
||||
entity.surface.create_entity{name="flying-text", position = {entity.position.x-1, entity.position.y}, text="+"..count.." [img=item.coin]", color={1, 0.8, 0, 0.5}, render_player_index=cause.player.index}
|
||||
local coins = {name="coin", count = count}
|
||||
if cause and cause.player and cause.name == 'character' and cause.player.can_insert(coins) then
|
||||
cause.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=cause.player.index}
|
||||
else -- spill them on the floor
|
||||
set_timeout_in_ticks(
|
||||
1,
|
||||
|
Loading…
x
Reference in New Issue
Block a user