For web client, don't crash game if can't allocate more memory from browser (usually because exceeding 2GB)

This commit is contained in:
UnknownShadow200 2020-03-12 15:03:14 +11:00
parent 93ae0ef5c9
commit 977fd97dbc
2 changed files with 3 additions and 3 deletions

View File

@ -87,7 +87,7 @@ build_osx64() {
build_web() {
echo "Building web.."
rm cc.js
$WEB_CC *.c -O1 -o cc.js -s FETCH=1 -s WASM=0 -s LEGACY_VM_SUPPORT=1 -s ALLOW_MEMORY_GROWTH=1 --preload-file texpacks/default.zip -w
$WEB_CC *.c -O1 -o cc.js -s FETCH=1 -s WASM=0 -s LEGACY_VM_SUPPORT=1 -s ALLOW_MEMORY_GROWTH=1 -s ABORTING_MALLOC=0 --preload-file texpacks/default.zip -w
# so game loads textures from classicube.net/static/default.zip
sed -i 's#cc.data#/static/default.zip#g' cc.js
# fix texture pack overlay always showing 'Download size: Determining..."

View File

@ -33,10 +33,10 @@ echo "Compiling nix64"
$NIX64_PATH $FILES -I ~/client/src/ -I ./src/ -o ${PLUGIN}_nix64.so $FLAGS $NIX_FLAGS
echo "Compiling mac32"
$MAC32_PATH $FILES -I ~/client/src/ -I ./src/ -o ${PLUGIN}_osx32.dylib $FLAGS $MAC_FLAGS
$MAC32_PATH $FILES -I ~/client/src/ -I ./src/ -o ${PLUGIN}_mac32.dylib $FLAGS $MAC_FLAGS
echo "Compiling mac64"
$MAC64_PATH $FILES -I ~/client/src/ -I ./src/ -o ${PLUGIN}_osx64.dylib $FLAGS $MAC_FLAGS
$MAC64_PATH $FILES -I ~/client/src/ -I ./src/ -o ${PLUGIN}_mac64.dylib $FLAGS $MAC_FLAGS
echo "Compiling win32"
rm ClassiCube.exe ClassiCube.def