Navigation Menu

Skip to content

Releases: nesbox/TIC-80

TIC-80 tiny computer 1.1.2837

22 Oct 12:16
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.1.2736...v1.1.2837

TIC-80 tiny computer 1.1.2736

27 Aug 10:17
Compare
Choose a tag to compare

What's Changed

  • Android: version code stuck #2283 by relan
  • Sprite editor touch screen not working properly(Android) #2270 by MateusH7
  • [Bug] [QuickJS] Glitches and crashes #2268 by scambier
  • Remap signature has changed in JavaScript #2267 by scambier
  • Some keys are not working #2265 by Kitsuinox
  • [Bug] CRT shader doesn't work on HTML exports with alone=1 #2229 by scambier
  • Some Android devices can't access tic files without rooted phone #2222 by rubensoleao

Full Changelog: v1.1.2729...v1.1.2736

v1.1.2729

17 Aug 18:50
Compare
Choose a tag to compare

What's Changed

New Contributors

Read more

TIC-80 tiny computer 1.0.2164

02 May 08:54
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.90.1723...v1.0.2164

TIC-80 tiny computer 0.90.1723

16 Jul 14:59
Compare
Choose a tag to compare

CHANGELOG v0.90.1723

CLOSED ISSUES

  1. #1517 - [0.90] "Cart has changed" dialog does not close
  2. #1513 - map editor: tile cursor not visible in 0.90
  3. #1494 - [0.90] Watcher fails when loading multiple carts
  4. #1510 - Unable to draw to bigger circles in 0.90
  5. #1499 - TIC-80 keeps stopping (Android)
  6. #1490 - [0.90] (Win7) getsystemtimepreciseasfiletime error in exported executable
  7. #1501 - TIC-80 is not opening on linux
  8. #1493 - Wonky icon [0.90 Bug]
  9. #1495 - [0.90] TIC-80 does not start
  10. #1492 - [0.90]No name and author name by pressing Ctrl+S to save cart.png
  11. #1496 - Won't Start in Firefox
  12. #1489 - [0.90 bug] ctrl+r returns multiple times

CHANGELOG v0.90.1706

THANKS to all the people who helped release this version, especially the contributors

@cogk
@Voklen
@brickviking
@schraf
@Karethoth
@jminor
@cgrs
@RobLoach
@txgruppi
@tstopak
@phlubby
@joshgoebel
@technomancy
@nalquas
@msx80
@asiekierka
@drako0812

MAIN CHANGES

image

Added text selection/copy/paste to the console

ezgif-1-3ed349c748d5


A cart can be saved and distributes as a PNG image, use save game.png command.
meat


TIC-80 can work like a compiler without UI with --cli command line parameter, for example here we load game.tic cart from current dir (use --fs .) and export it as game.exe executable for Windows:

$ ./tic80 --cli --fs . --cmd "load game.tic & export win game.exe & exit"

cart game.tic loaded!
use RUN command to run it

GET /export/0.90/win [100%]

game.exe exported :)

Also, games can be exported without access to the editors with alone=1 flag (PRO feature)
export linux game.exe alone=1


The help command was redesigned and you can get info about spec/ram/api/command/...

>help

usage: help [<text>|version|welcome|
spec|ram|vram|commands|api|startup|
terms|license]

>help api
API functions:
OVR SCN TIC btn btnp circ circb clip 
cls elli ellib exit fget font fset key 
keyp line map memcpy memset mget mouse 
mset music peek peek4 pix pmem poke 
poke4 print rect rectb reset sfx spr 
sync textri time trace tri trib tstamp

>help sync
---=== API ===---
sync(mask=0 bank=0 tocart=false)

The pro version of TIC-80 contains 8 
memory banks.
To switch between these banks, sync can 
be used to either load contents from a 
memory bank to runtime, or save 
contents from the active runtime to a 
bank.
The function can only be called once 
per frame.If you have manipulated the 
runtime memory (e.g. by using mset), 
you can reset the active state by 
calling sync(0,0,false).
This resets the whole runtime memory to 
the contents of bank 0.Note that sync 
is not used to load code from banks; 
this is done automatically.

Another useful thing you can export whole help info in Markdown format, use command export help cheatsheet.md


Added mouse capture functionality to receive relative values instead of the current cursor position (useful in first-person 3D games), the cursor is hidden and this mode. To enable this mode pls use poke(0x7FC3F,1,1) command.
Small example with enabling the relative mode:

function flip(val)return val>0 and 0 or 1 end

function TIC()
	if btnp(4)then 
		poke(0x7FC3F,flip(peek(0x7FC3F,1)),1)
	end	
		
	cls()
	local x,y=mouse()
	print(x..":"..y)
end

Added baremetal/rpi/3ds builds to Github Actions and all the Nightly Builds can be downloaded here https://nightly.link/nesbox/TIC-80/workflows/build/master


Now you can change bit mode in the map editor
ezgif-1-4c01dcf4fc08


On Android, you can switch between the system keyboard and TIC-80 internal keyboard
image
Hardware keyboard now detects automatically.

CLOSED ISSUES

  1. #1486 - Problems with Jxx and row parameter of the music () function again present. Old lines are being used in src/core/sound.c
  2. #1482 - Website: Can’t upload Fennel cartridges
  3. #1480 - Website: Page titles
  4. #1477 - saveid not working when exporting with alone=1
  5. #1475 - Add an additional parameter to peek/poke functions for diferent bit resolutions
  6. #1469 - TIC-80 crash on Windows XP
  7. #1455 - Move all the icons to the config.lua
  8. #1454 - TIC throws OOMs when trying to run this cart in browser
  9. #1447 - Cursor shows over bookmarks tab
  10. #1446 - M command retriggers note
  11. #1434 - map editor select appears over show tiles
  12. #1430 - Horizontal scrolling while shift is held
  13. #1421 - Navigate palette with [ and ] keys
  14. #1414 - Please add Git SHA to the build number version in console
  15. #1405 - Code outline items corruption
  16. #1398 - TIC-80 Crashes when I stream it in a Discord voice channel.
  17. #1396 - Buffer Overflow Vulnerability in src/studio/fs.c
  18. #1395 - Distribute Linux version as zip on itch.io for better itch.io app integration
  19. #1394 - Incorrect OVR palette
  20. #1388 - RESUME command doesn't restore screen bug
  21. #1380 - Update wiki: CHUNK_SCREEN, tic_screen, sync, etc.
  22. #1372 - Path does not update on console correctly bug
  23. #1370 - Editor does not update when pressing enter bug
  24. #1360 - music function crashes in javascript bug
  25. #1356 - Saving cartridge crashes the dev (Pro) build bug
  26. #1345 - Crash in editor with 1BPP mode bug
  27. #1343 - (end) add "Debug" to TIC_VERSION_LABEL for debug builds
  28. #1338 - TIC80 Freezes When Trying To Run Game After Saving As Lua bug
  29. #1332 - alt-tab inserts a space in the code editor bug
  30. #1331 - Little pause at the beginning of the music
  31. #1326 - current build crashes on 3ds
  32. #1323 - duktape submodule fetches all duktape versions ever released
  33. #1319 - Add new & popular filter to the website
  34. #1315 - Add pagination to the website website
  35. #1312 - [Request] Please add THEME.CODE.FG to alter foreground text in code editor
  36. #1308 - Add a chunk to load default palette/waveforms
  37. #1306 - Game exits to the console if you press ESC twice
  38. #1290 - Live reload not working bug
  39. #1282 - Dividing by Zero in line function causes Tic-80 to crash. bug
  40. #1275 - Please add back ability to name gifs
  41. #1273 - Distorted sound with 0.80.1345 Pro on Linux
  42. #1271 - new fennel creates the cart with the old palette
  43. #1269 - tic80 -h command outputs to nowhere unless redirected
  44. #1268 - Zlib compression does not seem to work in 0.80+ versions of TIC-80
  45. #1267 - Command line arguments do not work anymore in the latest commit
  46. #1264 - Make all the network requests async
  47. #1255 - CRT effect in mac
  48. #1254 - better clipboard support
  49. #1247 - Make TIC work more like a compiler. console
  50. #1246 - Add benchmark demos for every supported script.
  51. #1240 - When compiling TIC-80 with GCC Mingw-w64 it (mingw64) adds additional DLL dependencies
  52. #1239 - Gif export does not automatically add .gif extension
  53. #1227 - Feature: Add colors to text with control characters (like Commodore 64)
  54. #1226 - music() parameter changed? bug lang: javascript
  55. #1225 - Change Bits Per Pixel in the Map Editor editor: map
  56. #1224 - install target on Linux does not follow CMAKE_INSTALL_PREFIX
  57. #1220 - In HTML exported games, all unused buttons on Xbox One controller open/close the TIC menu
  58. #1216 - Please add a export for web platform: html5
  59. #1213 - Default text color is now a dark grey
  60. #1210 - Missing Xext.h on Armbian buster
  61. #1206 - Minor bug when typing "cd "
  62. #1205 - 0.80 running quite slower than 0.70.6
  63. #1195 - editor outline command ctrl+o scrolling not possible
  64. #1193 - Music() function with tempo parameters API
  65. #1192 - editor command for comment/uncomment for multiple lines bug editor: code
  66. #1188 - Creating or loading a cartridge resets font setting to default in code editor editor: code enhancement
  67. #1159 - (0.80 beta) No wave cut/copy/paste anymore in new SFX editor?
  68. #1111 - tic.c could be split into quasi-independent parts for api, io, core loop, drawing, music...
  69. #1102 - Add Keyboard Shortcuts for switching banks
  70. #1084 - Building without GTK dependencies
  71. #1044 - Error on openig in linux platform: linux
  72. #1033 - ls/dir fails to sort properly
  73. #1017 - Build succeeded : TIC-80 for Raspberry Pi (Raspbian Buster)
  74. #1003 - please add to the music editor the button "play from now on" editor: music
  75. #1001 - Use cover as raw binary screen buffer instead GIF
  76. #999 - (0.80-dev suggestion) Allow array of volumes in sfx() for left/right API
  77. #987 - key()/keyp() codes 66 to 78 don't work bug
  78. #986 - Suggestion: add a mouse capture functionality
  79. #979 - Replacement of circ() and circb() functions
  80. #978 - Add Keyboard Shortcuts to Music Editor
  81. #957 - CTRL+R doesn't work when launching a tic.computer/play cart SURF
  82. #923 - Website "store" improvements website
  83. #921 - Setup CI using Github Actions
  84. #912 - Integrating Raspberry Baremetal build
  85. #909 - Small font not working in "player" executable bug
  86. #901 - Properly name of cart.tic software in website website
  87. #832 - (0.80.0-dev Pro) Custom system sounds won't play at the correct speed bug
  88. #823 - corrupted size vs prev_size
  89. #799 - Native export shows "File not downloaded" bug
  90. #764 - Map editor: replace tile feature editor: map enhancement
  91. #755 - [Feature Request] Cartridge embedded in PNG export for easy sharing enhancement
  92. #749 - Music "joins" ch...
Read more

TIC-80 tiny computer 0.80.1344

03 Sep 13:20
Compare
Choose a tag to compare

CHANGELOG v0.80.1344

MAIN CHANGES

First of all, I want to say THANKS to all the people who helped release this version, especially the contributors

@asiekierka
@RobLoach
@ddelemeny
@technomancy
@anatolse
@stefandevai
@gouchi
@phcoder
@michaeldel
@wadetb
@farvardin
@buckle2000
@kawa-yoiko
@cuu
@GrahamClemo
@rudenkoarts
@librorumque
@kostik1337

The new version has a new UI made with the Sweetie16 palette designed by GrafxKid.

Code Editor

  1. added bookmarks support toggle [CTRL+F1], next [F1], prev [SHIFT+F1], remove all [CTRL+SHIFT+F1]
  2. added parentheses matching by @technomancy
  3. removed code banks and all the code limited by 64K of compressed data now
  4. added font shadow button
  5. removed dofile() function, but you can save cart in text format and edit in any editor you want, use save game.lua and folder to locate it
    image

Sprite Editor

  1. changed default palette to Sweetie16 made by GrafxKid
    image
  2. added the Advanced Mode button where you can edit sprite flags, scanline/overline palette, switch bits per pixel
    image
  3. with 4bpp, 2bpp, 1bpp modes you can store more sprites by lowering the color bit (added by @ddelemeny). Please, read Advanced Drawing Techniques article and look at bpp.tic demo
    bpp

Sfx Editor

  1. added stereo sound support, you can set the volume for left/right channels
  2. fully redesigned UI, I tried to fit all screens in one and added some wave animation
    sfx

Music Editor

  1. added music effects support, you can change master volume, play a chord, jump to frame, pitch bend, vibrato, delay
  2. added new Piano Mode, where you can edit notes/octaves using mouse
    image
  3. added waveform animation and follow mode
    music

Console

  1. added export sfx/music [index] command to export .wav
  2. export html creates .zip ready for production on itch.io with Web Assembly inside

CLOSED ISSUES

  1. #1148 - pmem command with html exports?
  2. #1145 - found bug in 0.80.1278-dev
  3. #1140 - difference in sfx noise behaviour switching from 0.70.6 to 0.80-dev
  4. #1139 - surf does not show all games
  5. #1138 - surf loops around at end only
  6. #1136 - workaround to load code from multi bank carts
  7. #1135 - add menu command to show game menu console
  8. #1130 - saving to a cart extension that isn't .tic doesn't display the overwrite warning
  9. #1090 - music editor with piano roll editor: music
  10. #1089 - create a tool to compile text carts to .tic
  11. #1085 - suggestion: change show/hide grid key in map editor
  12. #1075 - paren matching in code editor
  13. #1071 - sprite editor select tool jumbles the selection content when moved
  14. #1054 - remove all the duk_is_null_or_undefined in jsapi.c
  15. #983 - (0.80.0-dev) some carts that poke to sound registers are broken
  16. #977 - (0.80.0-dev) jxy command in music editor can softlock tic-80
  17. #973 - (0.80.0-dev) add stereo panning registers to ram layout?
  18. #972 - sounds not playing in google chrome in exported game
  19. #962 - loading cartridges with active code banks broken
  20. #948 - update squirrel
  21. #940 - tic-80 surf: show the cover image resolution is 480x272 after tic-80 cover image is broken
  22. #938 - use curl instead sdl2-net
  23. #931 - [music tracker] can no longer change octave
  24. #917 - appveyor failing
  25. #909 - small font not working in "player" executable
  26. #902 - palette loading bug
  27. #896 - copy table data directly to ram using memcpy()
  28. #889 - restore keyconfig command
  29. #873 - it's time to change default palette
  30. #870 - deploy all the builds to https://builds.tic80.com
  31. #850 - pmem with saveid is broken at least in chrome
  32. #837 - program crashes after random interval (10 min), bringing down xwayland
  33. #816 - command+k clear console
  34. #815 - osx: "no mountable file systems"
  35. #810 - --input: [gamepad/mouse/keyboard] issue
  36. #807 - display in non-sokol build
  37. #785 - keyboard on android version
  38. #783 - get rid of max_carts const
  39. #782 - extract 16kb vram from 80kb ram
  40. #777 - emscripten build issues and build instructions
  41. #747 - keyboard layout broken again! (0.80.0-dev)
  42. #732 - stereo sound support
  43. #725 - sound and music exporter
  44. #693 - add ovr() palette to the sprite editor
  45. #668 - 0.70.1 pro on android: back button broken bug
  46. #657 - switching between apps turns tic-80's screen black on android
  47. #585 - divide by zero crashes tic80
  48. #557 - "wiki" command does nothing in web build
  49. #452 - start into surf mode.
  50. #435 - fold function in code editor
  51. #382 - music editor: sustaining notes through frames
  52. #320 - maybe move to cmake or something similar?
  53. #261 - implement effects column in the music editor

MERGED PULL REQUESTS

  1. @asiekierka #1122 - 3ds port
  2. @asiekierka #1120 - surf: add support for using left/right or page up/page down to scroll
  3. @asiekierka #1119 - minor rendering optimizations
  4. @RobLoach #1114 - display the stack when there is an error
  5. @RobLoach #1053 - fix font() breaking when retrieving arguments
  6. @RobLoach #1045 - add timestamp() function
  7. @RobLoach #1028 - split up 3rd-party submodule into individual vendor submodules
  8. @RobLoach #851 - update to duktape 2.3.0
  9. @ddelemeny #1105 - modify blit segment spec
  10. @ddelemeny #1099 - variable bit-per-pixel drawing api
  11. @ddelemeny #1097 - draw studio popup after everything else
  12. @ddelemeny #1095 - enable chromakey array on map and textri
  13. @ddelemeny #1094 - fix segmentation fault caused by findmatcheddelim unsafe null pointer
  14. @ddelemeny #1061 - sort points vertically in ticline
  15. @technomancy #1101 - allow "export html foo.zip" to provide name non-interactively.
  16. @technomancy #1091 - wip: upgrade to fennel version 0.4
  17. @technomancy #1078 - accept and run commands from argv.
  18. @technomancy #840 - when -code-watch flag is passed, reload all the code upon resume.
  19. @anatolse #1066 - fixed some warnings from a static analyzer
  20. @stefandevai #1067 - update generated html
  21. @stefandevai #1064 - add sustain to notes and effects on frame change
  22. @stefandevai #1063 - follow cursor on music editor
  23. @gouchi #1048 - add libretro makefile
  24. @phcoder #1031 - make merge_static.sh executable
  25. @phcoder #1030 - allow overriding cmake_position_independent_code from command line
  26. @phcoder #1024 - fix resulting name for libretro emscripten variant
  27. @michaeldel #1012 - fix sdl cursors memory leak
  28. @wadetb #975 - touch keyboard tweaks and fix
  29. @wadetb #974 - fix android black screen when paused
  30. @wadetb #968 - map view fixes when wrapping around the edge
  31. @wadetb #967 - misc code editor additions/fixes
  32. @farvardin #930 - adding extra keys for the trackers
  33. @buckle2000 #839 - add using and local as moonscript keywords
  34. @kawa-yoiko #826 - fix sokol build vertically flipped under linux
  35. @kawa-yoiko #821 - fix (and simplify) blurry sokol rendering
  36. @kawa-yoiko #820 - fix colour replacement misses borders
  37. @kawa-yoiko #819 - workaround for freeze on fullscreen under macos
  38. @cuu #813 - fix -fullscreen
  39. @GrahamClemo #759 - add squirrel language support to tic-80
  40. @rudenkoarts #744 - wren code outline
  41. @librorumque #739 - respect palette map for sprite colorkey
  42. @kostik1337 #733 - added single-param pmem function in wren api

TIC-80 tiny computer 0.70.6

24 Aug 07:15
Compare
Choose a tag to compare

CHANGELOG

version 0.70.5 (https://github.com/nesbox/TIC-80/milestone/24?closed=1)

0.70.6

  • GL3 shader error bug #678
  • Wiki command does nothing on Android bug #659
  • Caps Lock not working bug #661
  • Keyboard mappings broken! bug #655
  • Re-enable tumbler mouse clicks bug #688 (thank you @DB0z)
  • Gently clicking the right side on the Code Editor scrolls the entire screen while using the small font bug #682
  • Add config flag to make tiny font default editors enhancement #666
  • When using Wren, sync() writes data to cart instead of restoring it bug #673
  • #673 #684 fix (sync() with no arguments in wren) (thank you @DB0z)
  • The file system doesn't work in 0.70.1 bug #664
  • Music editor stucks on the last note bug #662

TIC-80 tiny computer 0.70.1

12 Aug 07:50
Compare
Choose a tag to compare
Pre-release

CHANGELOG

version 0.70.1 (https://github.com/nesbox/TIC-80/milestone/23?closed=1)

0.70.1

  • added own touch keyboard on Android
    image
  • added alternative tiny font, you can use it in the Code Editor or in the API
    screen
  • added Wren language support http://wren.io (thank you @RudenkoArts)
  • added Fennel language support https://fennel-lang.org (thank you @technomancy)
  • added eval command (thank you @technomancy)
  • added CRT monitor effect, use F6 to enable/disable it (works on every platform supported OpenGL)
    image
  • removed VSYNC support, using delay instead, so TIC should work on monitors > 60Hz without sound desync
  • added stack trace on an error (thank you @jahodfra)
  • fixed selection flipping in the Sprite Editor (thank you @frenetic)
  • use CTRL+PGUP/PGDN to switch modes (thank you @technomancy)
  • added Quit TIC-80 to the game menu
  • added -uiscale command line argument (UI_SCALE in the config)
  • added menu to build.sh script (thank you @matimati433)
  • added Travis Continuous Integration service
  • fixed UV errors, clipping and some improvements in textri api (thank you MonstersGoBoom)
  • fixed error on startup in Firefox
  • SDL2 lib extracted as a separated entity

you can review full changelog here https://github.com/nesbox/TIC-80/milestone/23?closed=1

Thanks all for the support and Pull Requests.

PS.
I hope next update will be released earlier than a half year :)

TIC-80 tiny computer 0.60.3

24 Dec 13:35
Compare
Choose a tag to compare

CHANGELOG

version 0.60.3 (https://github.com/nesbox/TIC-80/milestone/22?closed=1)

0.60.3

  • Persistent Memory (PMEM) moved from 80K RAM layout and has 1KB now (you can store up to 256 integers). Freed space (28 bytes) used to store data for 4 gamepads + mouse XY and buttons + keyboard
  • added keyboard support (use key() / keyp() API)
  • you can use mouse / gamepad / keyboard simultaneously, and you can use up to 4 gamepads
  • removed KEYMAP command, you can configure gamepad mapping in the GAME MENU
  • you will see SYNC label (synchronization error) if your game doesn't fit 60 FPS (only native, doesn't work in web version)
  • mouse pointer disappears in games that don't support it (in games with declared -- input: gamepad or -- input: keyboard)
  • mirror/rotate selection in the Sprite Editor
  • SDL updated 2.0.7

0.60.0

  • added optimisations for main render function and some draw API, like draw spr, circ and tri, now they > 2x faster (by @jahodfra)
  • added special Overlap Mode (OVR), it allows you to do things like this:
    par
    ... here I draw BG in TIC() function and change palette and screen offset in scanline() callback, then I draw Ship sprite in OVR() function as though it will be on a separate layer
  • added -skip command line option to run TIC without startup animation
  • added -fullscreen command line option to run in Fullscreen
  • added shadow variable to the Config to hide shadow in the Code Editor
  • you can exit infinite loop in Lua and JS by pressing ESC now
  • added reset() API, to restore your game to initial state
  • syntax highlighter in the Code Editor was totally rewritten and works 100x faster now
  • [PRO feature] added Bank Switching, for people who want to create a really big game, you can switch between 8 banks in Runtime using sync() API, you can do it only one time per frame for tiles, sprites, map, sfx, music, info here https://github.com/nesbox/TIC-80/wiki/sync#parameters
  • fixed keyboard focus on Android
  • fixed selected deletion in Sprite Editor (by @frenetic)
  • Sprite and Map editors render in OVR mode now (UI is not changed at all if change palette)
  • added random generator pre-seeding on every game start
  • and other minor fixes...

Thanks for contributions:
@jahodfra
@frenetic

and others, for the bug reports!

TIC-80 tiny computer 0.50.1

28 Nov 07:04
Compare
Choose a tag to compare

CHANGELOG

version 0.50.1 (https://github.com/nesbox/TIC-80/milestone/21?closed=1)

added:

  • you can define cart storage directory as first parameter in command line, tic80 . will use current directory as storage, tic80 ../path/to/cart.tic will use ../path/to/ as storage and load cart.tic
  • added PRO version of TIC, you can get it here for $5 https://nesbox.itch.io/tic, or build yourself using make linux-pro for example
  • added text version of carts and you can edit it in any editor, use 'save cart.lua' to get text version of your cart [PRO feature]
  • optimised spr() function performance (got 20000 points in benchmark, 13000 was before)
  • tic renamed to tic80
  • sync() api has new direction parameter, true -> sync from RAM to cart, false -> sync from cart to RAM (useful to restore cart data in the RAM)
  • you can paste sigle color value in the palette editor
  • added benchmark.tic cart to demos
  • run tic80 -surf to start in SURF mode
  • run tic80 -nosound to start in silent mode
  • run tic80 -fullscreen to start in fullscreen mode
  • makefile flags to build with LTO (link time optimisation)
  • added 1px shadow to text in the Code Editor
  • updated makefile to build on any version of Linux (Arch/RPi/...)
  • added edit command to show editors
  • added version command
  • added RETINA support on MacOSX

fixed:

  • pix() api color bounds
  • warning message emits a tone on unsaved cart
  • sprites export with wrong palette
  • scanline position and border, all render to one texture 256x144px
  • fixed live reload
  • fixed some crashes
  • removed some compilation warnings
  • XYUV's switched to floats in textri(), also fixed crash

Thanks for contributions:

@MonstersGoBoom
@josefnpat
@jahodfra