summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Kasatkin <mk@realbadangel.pl>2012-09-08 10:32:13 +0200
committerMaciej Kasatkin <mk@realbadangel.pl>2012-09-08 10:32:13 +0200
commitf845d9e4e712f38fd1c3246e322805a1181a8171 (patch)
tree9e779e84416e9702e933d70b90605c8b7b8d472f
parentd455791cfb2d93e3625c1db103f069fa11c3d566 (diff)
production depends on height (by iqualfragile)
-rw-r--r--solar_panel.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/solar_panel.lua b/solar_panel.lua
index 9a3a873..9bdb8b8 100644
--- a/solar_panel.lua
+++ b/solar_panel.lua
@@ -59,7 +59,9 @@ minetest.register_abm(
meta:set_float("active",1)
local internal_EU_buffer=meta:get_float("internal_EU_buffer")
local internal_EU_buffer_size=meta:get_float("internal_EU_buffer_size")
- local charge_to_give=80
+ local charge_to_give=40+(pos1.y/250*40) -- make solar energy depending on height
+ if charge_to_give<0 then charge_to_give=0 end
+ if charge_to_give>160 then charge_to_give=160 end
if internal_EU_buffer+charge_to_give>internal_EU_buffer_size then
charge_to_give=internal_EU_buffer_size-internal_EU_buffer
end