2383 if cWindSpeed.isNegative then |
2383 if cWindSpeed.isNegative then |
2384 CWindSpeedf := -cWindSpeedf; |
2384 CWindSpeedf := -cWindSpeedf; |
2385 AddVisualGear(0, 0, vgtSmoothWindBar); |
2385 AddVisualGear(0, 0, vgtSmoothWindBar); |
2386 end; |
2386 end; |
2387 lc_setwind:= 0 |
2387 lc_setwind:= 0 |
|
2388 end; |
|
2389 |
|
2390 function lc_getwind(L : Plua_State) : LongInt; Cdecl; |
|
2391 var wind: extended; |
|
2392 begin |
|
2393 if CheckLuaParamCount(L, 0, 'GetWind', '') then |
|
2394 begin |
|
2395 wind:= hwFloat2float((cWindSpeed / cMaxWindSpeed) * 100); |
|
2396 if wind < -100 then |
|
2397 wind:= -100 |
|
2398 else if wind > 100 then |
|
2399 wind:= 100; |
|
2400 lua_pushnumber(L, wind); |
|
2401 end |
|
2402 else |
|
2403 lua_pushnil(L); |
|
2404 lc_getwind:= 1 |
2388 end; |
2405 end; |
2389 |
2406 |
2390 function lc_maphasborder(L : Plua_State) : LongInt; Cdecl; |
2407 function lc_maphasborder(L : Plua_State) : LongInt; Cdecl; |
2391 begin |
2408 begin |
2392 if CheckLuaParamCount(L, 0, 'MapHasBorder', '') then |
2409 if CheckLuaParamCount(L, 0, 'MapHasBorder', '') then |
3672 lua_register(luaState, _P'SetGearPos', @lc_setgearpos); |
3689 lua_register(luaState, _P'SetGearPos', @lc_setgearpos); |
3673 lua_register(luaState, _P'GetGearCollisionMask', @lc_getgearcollisionmask); |
3690 lua_register(luaState, _P'GetGearCollisionMask', @lc_getgearcollisionmask); |
3674 lua_register(luaState, _P'SetGearCollisionMask', @lc_setgearcollisionmask); |
3691 lua_register(luaState, _P'SetGearCollisionMask', @lc_setgearcollisionmask); |
3675 lua_register(luaState, _P'GetRandom', @lc_getrandom); |
3692 lua_register(luaState, _P'GetRandom', @lc_getrandom); |
3676 lua_register(luaState, _P'SetWind', @lc_setwind); |
3693 lua_register(luaState, _P'SetWind', @lc_setwind); |
|
3694 lua_register(luaState, _P'GetWind', @lc_getwind); |
3677 lua_register(luaState, _P'MapHasBorder', @lc_maphasborder); |
3695 lua_register(luaState, _P'MapHasBorder', @lc_maphasborder); |
3678 lua_register(luaState, _P'GetHogHat', @lc_gethoghat); |
3696 lua_register(luaState, _P'GetHogHat', @lc_gethoghat); |
3679 lua_register(luaState, _P'SetHogHat', @lc_sethoghat); |
3697 lua_register(luaState, _P'SetHogHat', @lc_sethoghat); |
3680 lua_register(luaState, _P'EraseSprite', @lc_erasesprite); |
3698 lua_register(luaState, _P'EraseSprite', @lc_erasesprite); |
3681 lua_register(luaState, _P'PlaceSprite', @lc_placesprite); |
3699 lua_register(luaState, _P'PlaceSprite', @lc_placesprite); |