Add support for the game Asuna (#126)

This commit is contained in:
Joachim Stolberg 2023-04-13 20:20:58 +02:00
parent 9e226d6d8a
commit 9e1ae22bf4

View File

@ -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