aboutsummaryrefslogtreecommitdiff
path: root/assets/blender/trackvertical1.png
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2019-08-11 20:16:11 +0200
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2019-08-11 20:16:11 +0200
commit2d8c13885aa33a0f5eb43b16a1131f187fad75e7 (patch)
tree8bddf1888edfa105c613ba38a70aea05c4aa8334 /assets/blender/trackvertical1.png
parentef50610f675c85cb0c85eb200018896cefd0cc11 (diff)
downloadadvtrains-2d8c13885aa33a0f5eb43b16a1131f187fad75e7.tar.gz
advtrains-2d8c13885aa33a0f5eb43b16a1131f187fad75e7.tar.bz2
advtrains-2d8c13885aa33a0f5eb43b16a1131f187fad75e7.zip
Shunting mode now couples trains on collision.
Trains now get coupled when one of them is in coupling mode.
Diffstat (limited to 'assets/blender/trackvertical1.png')
0 files changed, 0 insertions, 0 deletions
139'>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 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249
/*
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 "cpp_api/s_item.h"
#include "cpp_api/s_internal.h"
#include "common/c_converter.h"
#include "common/c_content.h"
#include "lua_api/l_item.h"
#include "lua_api/l_inventory.h"
#include "server.h"
#include "log.h"
#include "util/pointedthing.h"
#include "inventory.h"
#include "inventorymanager.h"

bool ScriptApiItem::item_OnDrop(ItemStack &item,
		ServerActiveObject *dropper, v3f pos)
{
	SCRIPTAPI_PRECHECKHEADER

	int error_handler = PUSH_ERROR_HANDLER(L);

	// Push callback function on stack
	if (!getItemCallback(item.name.c_str(), "on_drop"))
		return false;

	// Call function
	LuaItemStack::create(L, item);
	objectrefGetOrCreate(L, dropper);
	pushFloatPos(L, pos);
	PCALL_RES(lua_pcall(L, 3, 1, error_handler));
	if (!lua_isnil(L, -1)) {
		try {
			item = read_item(L,-1, getServer());
		} catch (LuaError &e) {
			throw LuaError(std::string(e.what()) + ". item=" + item.name);