From 7b445fbc7775d7c6205274fdd87b99c57b79c783 Mon Sep 17 00:00:00 2001 From: Andrei Alexeyev Date: Wed, 1 Apr 2020 02:15:13 +0300 Subject: [PATCH] ent->spawn_id must not overflow --- src/entity.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/entity.c b/src/entity.c index 962928ed..77e01ed8 100644 --- a/src/entity.c +++ b/src/entity.c @@ -84,12 +84,7 @@ void ent_register(EntityInterface *ent, EntityType type) { ent->index = entities.num++; ent->spawn_id = ++entities.total_spawns; - if(ent->spawn_id == 0) { - // This is not really an error, but it may result in weird draw order - // in some corner cases. If this overflow ever actually occurs, though, - // then you've probably got much bigger problems. - log_warn("spawn_id just overflowed. You might be spawning stuff waaaay too often"); - } + assert(ent->spawn_id > 0); if(entities.capacity < entities.num) { entities.capacity *= 2;