aboutsummaryrefslogtreecommitdiff
path: root/misc/minetest.appdata.xml
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2015-02-21 11:51:12 +0100
committerLoic Blot <loic.blot@unix-experience.fr>2015-02-21 11:51:12 +0100
commitcf4045ff0f7c96614e64b2b336e62a240f443ea6 (patch)
tree7229e1a72487b22d55aba067b15619490d730d58 /misc/minetest.appdata.xml
parent81930b17297bbb3c5f938d202c68903b18c83734 (diff)
Use proper CMakeLists.txt for network and client directories
Diffstat (limited to 'misc/minetest.appdata.xml')
0 files changed, 0 insertions, 0 deletions
>91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 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 168 169
-- atc_rail.lua
-- registers and handles the ATC rail. Active component.
-- This is the only component that can interface with trains, so train interface goes here too.

--Using subtable
local r={}

function r.fire_event(pos, evtdata)
	
	local ph=minetest.pos_to_string(pos)
	local railtbl = atlatc.active.nodes[ph]
	
	if not railtbl then
		atwarn("LuaAutomation ATC interface rail at",ph,": Data not in memory! Please visit position and click 'Save'!")
		return
	end
	
	
	local arrowconn = railtbl.arrowconn
	if not arrowconn then
		atwarn("LuaAutomation ATC interface rail at",ph,": Incomplete Data! Please visit position and click 'Save'!")
		return
	end
	
	--prepare ingame API for ATC. Regenerate each time since pos needs to be known
	--If no train, then return false.
	local train_id=advtrains.get_train_at_pos(pos)
	local train, atc_arrow, tvel
	if train_id then train=advtrains.trains[train_id] end
	if train then 
		if not train.path then
			--we happened to get in between an invalidation step
			--delay
			atlatc.interrupt.add(0,pos,evtdata)
			return
		end
		local index = advtrains.path_lookup(train, pos)
				
		local iconnid = 1
		if index then
			iconnid = train.path_cn[index]
		else