Skip to content

Commit

Permalink
EasterEgg: Call onDelete if removed
Browse files Browse the repository at this point in the history
  • Loading branch information
robothauler committed May 20, 2018
1 parent ec47b8d commit f6a9ce9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions data/modules/EasterEgg/Message.lua
Expand Up @@ -35,6 +35,9 @@ local onChat = function (form, ref, option)
form:SetMessage("\n" .. flavours[ad.flavour].body)
end

local onDelete = function (ref)
ads[ref] = nil
end

local makeAdvert = function (station, flavour_index)

Expand All @@ -47,6 +50,7 @@ local makeAdvert = function (station, flavour_index)
local ref = station:AddAdvert({
description = ad.desc,
-- icon = "lightning",
onDelete = onDelete,
onChat = onChat})
ads[ref] = ad

Expand Down

0 comments on commit f6a9ce9

Please sign in to comment.