diff --git a/src/entities/evilBlobs/evilBlob.c b/src/entities/evilBlobs/evilBlob.c index 5d044b2..ab12864 100644 --- a/src/entities/evilBlobs/evilBlob.c +++ b/src/entities/evilBlobs/evilBlob.c @@ -293,19 +293,22 @@ static void die(void) u->dx = (randF() - randF()) * 5; - switch (rand() % 3) + if (app.config.blood) { - case 0: - playBattleSound(SND_DEATH_1, u->uniqueId % MAX_SND_CHANNELS, u->x, u->y); - break; + switch (rand() % 3) + { + case 0: + playBattleSound(SND_DEATH_1, u->uniqueId % MAX_SND_CHANNELS, u->x, u->y); + break; - case 1: - playBattleSound(SND_DEATH_2, u->uniqueId % MAX_SND_CHANNELS, u->x, u->y); - break; + case 1: + playBattleSound(SND_DEATH_2, u->uniqueId % MAX_SND_CHANNELS, u->x, u->y); + break; - case 2: - playBattleSound(SND_DEATH_3, u->uniqueId % MAX_SND_CHANNELS, u->x, u->y); - break; + case 2: + playBattleSound(SND_DEATH_3, u->uniqueId % MAX_SND_CHANNELS, u->x, u->y); + break; + } } } diff --git a/src/entities/evilBlobs/evilBlob.h b/src/entities/evilBlobs/evilBlob.h index 8c10cd5..8302cda 100644 --- a/src/entities/evilBlobs/evilBlob.h +++ b/src/entities/evilBlobs/evilBlob.h @@ -35,6 +35,7 @@ extern int rrnd(int low, int high); extern void throwFleshChunks(float x, float y, int amount); extern void updateObjective(char *targetName); +extern App app; extern Dev dev; extern Entity *self; extern Game game; diff --git a/src/world/effects.c b/src/world/effects.c index 1802760..951c53d 100644 --- a/src/world/effects.c +++ b/src/world/effects.c @@ -38,18 +38,21 @@ void addSmallFleshChunk(float x, float y) { Decoration *chunk; - chunk = malloc(sizeof(Decoration)); - memset(chunk, 0, sizeof(Decoration)); - initFleshChunk(chunk); - - chunk->x = x; - chunk->y = y; - chunk->health = FPS / 4; - chunk->sprite[0] = chunk->sprite[1] = chunk->sprite[2] = fleshChunk[0]; - - if (app.config.blood == 2) + if (app.config.blood) { - chunk->health = FPS * rrnd(2, 4); + chunk = malloc(sizeof(Decoration)); + memset(chunk, 0, sizeof(Decoration)); + initFleshChunk(chunk); + + chunk->x = x; + chunk->y = y; + chunk->health = FPS / 4; + chunk->sprite[0] = chunk->sprite[1] = chunk->sprite[2] = fleshChunk[0]; + + if (app.config.blood == 2) + { + chunk->health = FPS * rrnd(2, 4); + } } } diff --git a/src/world/map.c b/src/world/map.c index 3c06846..e6785b5 100644 --- a/src/world/map.c +++ b/src/world/map.c @@ -144,7 +144,7 @@ int isSolid(int x, int y) void addBloodDecal(int x, int y) { - if (isSolid(x, y) && world.map.decal[x][y] == 0) + if (app.config.blood && isSolid(x, y) && world.map.decal[x][y] == 0) { world.map.decal[x][y] = (int) rrnd(1, 4); } diff --git a/src/world/map.h b/src/world/map.h index e4a4a02..e1eb034 100644 --- a/src/world/map.h +++ b/src/world/map.h @@ -27,6 +27,7 @@ extern float limit(float i, float a, float b); extern char *readCompressedFile(const char *filename); extern int rrnd(int low, int high); +extern App app; extern Camera camera; extern World world;