diff --git a/src/weapon.c b/src/weapon.c index b9b1bd5..329fe87 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -13,7 +13,7 @@ #include "spfx.h" #include "weapon.h" -#define weapon_isSmart(w) (w->think) +#define weapon_isSmart(w) (w->think != NULL) #define VOICE_PRIORITY_BOLT 10 /* Default. */ #define VOICE_PRIORITY_AMMO 8 /* Higher. */ @@ -263,6 +263,8 @@ static void weapon_update(Weapon* w, const double dt, WeaponLayer layer) { gl_getSpriteFromDir(&wsx, &wsy, gfx, w->solid->dir); for(i = 0; i < pilot_nstack; i++) { + /* Check for player to exist. */ + if((i == 0) && (player == NULL)) continue; psx = pilot_stack[i]->tsx; psy = pilot_stack[i]->tsy;