From ffd6dd4590fff4d62f2a0bf9dbb13ea975f5aa2a Mon Sep 17 00:00:00 2001 From: Kevin Shanahan Date: Tue, 13 Nov 2012 09:17:26 +1030 Subject: [PATCH] world: copy paranoid check into QWSV code Update the comment while I still remember what that was (probably) about. Signed-off-by: Kevin Shanahan --- NQ/world.c | 5 ++++- QW/server/world.c | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/NQ/world.c b/NQ/world.c index f097b69..131149f 100644 --- a/NQ/world.c +++ b/NQ/world.c @@ -299,7 +299,10 @@ SV_TouchLinks(edict_t *ent, areanode_t *node) /* touch linked edicts */ for (l = node->trigger_edicts.next; l != &node->trigger_edicts; l = next) { - /* FIXME - Is this just paranoia? */ + /* + * FIXME - Just paranoia? Check if this can really happen... + * (I think it was related to the E2M2 drawbridge bug) + */ if (!l || !l->next) Host_Error("%s: encountered NULL link", __func__); diff --git a/QW/server/world.c b/QW/server/world.c index 1cff433..d7c6f3d 100644 --- a/QW/server/world.c +++ b/QW/server/world.c @@ -362,6 +362,13 @@ SV_TouchLinks(edict_t *ent, areanode_t *node) /* touch linked edicts */ for (l = node->trigger_edicts.next; l != &node->trigger_edicts; l = next) { + /* + * FIXME - Just paranoia? Check if this can really happen... + * (I think it was related to the E2M2 drawbridge bug) + */ + if (!l || !l->next) + SV_Error("%s: encountered NULL link", __func__); + next = l->next; touch = EDICT_FROM_AREA(l); if (touch == ent)