diff --git a/polymer/eduke32/build/src/sdlayer.c b/polymer/eduke32/build/src/sdlayer.c index 1ef1a21e4..b126d9b17 100644 --- a/polymer/eduke32/build/src/sdlayer.c +++ b/polymer/eduke32/build/src/sdlayer.c @@ -319,6 +319,7 @@ int32_t initsystem(void) } signal(SIGSEGV, sighandler); + signal(SIGILL, sighandler); /* clang -fcatch-undefined-behavior uses an ill. insn */ signal(SIGABRT, sighandler); signal(SIGFPE, sighandler); diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index e063160b0..23f9a548b 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -487,7 +487,8 @@ int32_t block_deletesprite = 0; #ifdef POLYMER static void A_DeletePolymerLight(int32_t s) { - polymer_deletelight(actor[s].lightId); + if (actor[s].lightId >= 0) + polymer_deletelight(actor[s].lightId); actor[s].lightId = -1; actor[s].lightptr = NULL; } diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 1a1093c9e..e69ba2402 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -315,6 +315,7 @@ static void DeletePolymerLights(void) if (spritelightptr[i] != NULL) { polymer_deletelight(spritelightid[i]); + spritelightid[i] = -1; spritelightptr[i] = NULL; } }