From 9e1ae22bf4f92fab775781e388d18527fee0174f Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Thu, 13 Apr 2023 20:20:58 +0200 Subject: [PATCH] Add support for the game Asuna (#126) --- basis/windturbine_lib.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/basis/windturbine_lib.lua b/basis/windturbine_lib.lua index 2aa9355..bbd4397 100644 --- a/basis/windturbine_lib.lua +++ b/basis/windturbine_lib.lua @@ -3,7 +3,7 @@ TechAge ======= - Copyright (C) 2019-2020 Joachim Stolberg + Copyright (C) 2019-2023 Joachim Stolberg AGPL v3 See LICENSE.txt for more information @@ -16,6 +16,12 @@ local S = techage.S local P = minetest.string_to_pos local M = minetest.get_meta +local OCEAN = "ocean" + +if minetest.global_exists("asuna") then + OCEAN = "below" +end + local function chat_message(player_name, msg) if player_name then minetest.chat_send_player(player_name, S("[TA4 Wind Turbine]").." "..msg) @@ -39,7 +45,7 @@ function techage.valid_place_for_windturbine(pos, player_name, num_turbines) local data = minetest.get_biome_data({x=pos.x, y=-2, z=pos.z}) if data then local name = minetest.get_biome_name(data.biome) - if not string.find(name, "ocean") then + if not string.find(name, OCEAN) then return chat_message(player_name, S("This is a").." "..name.." "..S("biome and no ocean!")) end end