solved bug with alerting
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>
Sat, 18 Nov 2017 11:57:46 +0000 (12:57 +0100)
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>
Sat, 18 Nov 2017 11:57:46 +0000 (12:57 +0100)
init.lua

index 9f518e8..2852e6c 100644 (file)
--- a/init.lua
+++ b/init.lua
@@ -123,7 +123,7 @@ smartshop.receive_fields=function(player,pressed)
                                        if type==1 then \r
                                                inv:remove_item("main", stack)\r
                                                inv:add_item("main", pay)\r
-                                               if not inv:contains_item("main", stack) and not meta:get_int("alerted") or meta:get_int("alerted") == 0 then\r
+                                               if not inv:contains_item("main", stack)  and (not meta:get_int("alerted") or meta:get_int("alerted") == 0) then\r
                                                   meta:set_int("alerted",1) -- Do not alert twice\r
                                                   smartshop.send_mail(meta:get_string("owner"), pos, stack)\r
                                                end\r