aboutsummaryrefslogtreecommitdiff
path: root/textures/base/pack/joystick_bg.png
diff options
context:
space:
mode:
authorMuhammad Nur Hidayat Yasuyoshi <admin@mnh48.moe>2020-04-21 04:02:11 +0000
committersfan5 <sfan5@live.de>2020-06-13 23:13:43 +0200
commitc3306c469ae22bb20a16ae277a4d0443d68da115 (patch)
treedf594578582e6e7bfa7c6758d89eb263ff150b8e /textures/base/pack/joystick_bg.png
parenteeb85c304bb90ae51211d6ae962da900ab36b0a3 (diff)
downloadminetest-c3306c469ae22bb20a16ae277a4d0443d68da115.tar.gz
minetest-c3306c469ae22bb20a16ae277a4d0443d68da115.tar.bz2
minetest-c3306c469ae22bb20a16ae277a4d0443d68da115.zip
Translated using Weblate (Malay)
Currently translated at 100.0% (1288 of 1288 strings)
Diffstat (limited to 'textures/base/pack/joystick_bg.png')
0 files changed, 0 insertions, 0 deletions
href='#n120'>120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#include "lua_api/l_nodetimer.h"
#include "lua_api/l_internal.h"
#include "environment.h"
#include "map.h"


int NodeTimerRef::gc_object(lua_State *L) {
	NodeTimerRef *o = *(NodeTimerRef **)(lua_touserdata(L, 1));
	delete o;
	return 0;
}

NodeTimerRef* NodeTimerRef::checkobject(lua_State *L, int narg)
{
	luaL_checktype(L, narg, LUA_TUSERDATA);
	void *ud = luaL_checkudata(L, narg, className);
	if(!ud) luaL_typerror(L, narg, className);
	return *(NodeTimerRef**)ud;  // unbox pointer
}

int NodeTimerRef::l_set(lua_State *L)
{
	NodeTimerRef *o = checkobject(L, 1);
	ServerEnvironment *env = o->m_env;
	if(env == NULL) return 0;
	f32 t = luaL_checknumber(L,2);
	f32 e = luaL_checknumber(L,3);
	env->getMap().setNodeTimer(o->m_p,NodeTimer(t,e));
	return 0;
}

int NodeTimerRef::l_start(lua_State *L)
{
	NodeTimerRef *o = checkobject(L, 1);
	ServerEnvironment *env = o->m_env;
	if(env == NULL) return 0;
	f32 t = luaL_checknumber(L,2);
	env->getMap().setNodeTimer(o->m_p,NodeTimer(t,0));
	return 0;
}

int NodeTimerRef::l_stop(lua_State *L)
{
	NodeTimerRef *o = checkobject(L, 1);
	ServerEnvironment *env = o->m_env;
	if(env == NULL) return 0;
	env->getMap().removeNodeTimer(o->m_p);
	return 0;
}

int NodeTimerRef::l_is_started(lua_State *L)
{
	NodeTimerRef *o = checkobject(L, 1);
	ServerEnvironment *env = o->m_env;
	if(env == NULL) return 0;

	NodeTimer t = env->getMap().getNodeTimer(o->m_p);