]> git.lizzy.rs Git - nothing.git/blobdiff - src/game/level/explosion.c
(#819) Integrate LevelEditor Regions with Level
[nothing.git] / src / game / level / explosion.c
index 47f897ea443d33ff62b9a315eabab124a929bc35..a0f4f57c696237f4bbad642e03d50aed9206af52 100644 (file)
@@ -1,4 +1,4 @@
-#include <SDL2/SDL.h>
+#include <SDL.h>
 #include "system/stacktrace.h"
 
 #include "explosion.h"
@@ -32,11 +32,8 @@ Explosion *create_explosion(Color color,
                             float duration)
 {
     Lt *lt = create_lt();
-    if (lt == NULL) {
-        return NULL;
-    }
 
-    Explosion *explosion = PUSH_LT(lt, nth_alloc(sizeof(Explosion)), free);
+    Explosion *explosion = PUSH_LT(lt, nth_calloc(1, sizeof(Explosion)), free);
     if (explosion == NULL) {
         RETURN_LT(lt, NULL);
     }
@@ -47,7 +44,7 @@ Explosion *create_explosion(Color color,
     explosion->duration = duration;
     explosion->time_passed = duration;
 
-    explosion->pieces = PUSH_LT(lt, nth_alloc(sizeof(Piece) * EXPLOSION_PIECE_COUNT), free);
+    explosion->pieces = PUSH_LT(lt, nth_calloc(1, sizeof(Piece) * EXPLOSION_PIECE_COUNT), free);
     if (explosion->pieces == NULL) {
         RETURN_LT(lt, NULL);
     }