aboutsummaryrefslogtreecommitdiff
path: root/assets/blender/industrial
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2020-06-10 20:56:35 +0200
committerorwell96 <orwell@bleipb.de>2020-06-10 20:56:35 +0200
commitb13c7259763aa5c150e25c894a621a59b7bd37d4 (patch)
treefac9cd110c969ba5ca427dd42f19296402643355 /assets/blender/industrial
parentd61c2145a0f28438b0f85345bc7808ce0b6161c6 (diff)
downloadadvtrains-b13c7259763aa5c150e25c894a621a59b7bd37d4.tar.gz
advtrains-b13c7259763aa5c150e25c894a621a59b7bd37d4.tar.bz2
advtrains-b13c7259763aa5c150e25c894a621a59b7bd37d4.zip
Workaround to handle split points (dt. aufgefahrene Weichen), fixing H#77
Diffstat (limited to 'assets/blender/industrial')
0 files changed, 0 insertions, 0 deletions
7 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 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 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287
/*
** $Id: ltablib.c,v 1.38.1.3 2008/02/14 16:46:58 roberto Exp $
** Library for Table Manipulation
** See Copyright Notice in lua.h
*/


#include <stddef.h>

#define ltablib_c
#define LUA_LIB

#include "lua.h"

#include "lauxlib.h"
#include "lualib.h"


#define aux_getn(L,n)	(luaL_checktype(L, n, LUA_TTABLE), luaL_getn(L, n))


static int foreachi (lua_State *L) {
  int i;
  int n = aux_getn(L, 1);
  luaL_checktype(L, 2, LUA_TFUNCTION);
  for (i=1; i <= n; i++) {
    lua_pushvalue(L, 2);  /* function */
    lua_pushinteger(L, i);  /* 1st argument */
    lua_rawgeti(L, 1, i);  /* 2nd argument */
    lua_call(L, 2, 1);
    if (!lua_isnil(L, -1))
      return 1;
    lua_pop(L, 1);  /* remove nil result */
  }
  return 0;
}


static int foreach (lua_State *L) {
  luaL_checktype(L, 1, LUA_TTABLE);
  luaL_checktype(L, 2, LUA_TFUNCTION);
  lua_pushnil(L);  /* first key */
  while (lua_next(L, 1)) {
    lua_pushvalue(L, 2);  /* function */
    lua_pushvalue(L, -3);  /* key */