From 98e43ac0d94b5813fb2abcfb9f73842f8df0f116 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 25 Oct 2016 16:15:17 +0100 Subject: [PATCH] Fixed ffloor_t Lua variables not actually saving to $$$.sav Stupid overlooked semicolons --- src/lua_script.c | 4 ++-- src/p_spec.c | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/lua_script.c b/src/lua_script.c index 158b1bc4b..35d3fd51f 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -715,10 +715,10 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex) if (!rover) WRITEUINT8(save_p, ARCH_NULL); else { - ffloor_t *r2 = NULL; + ffloor_t *r2; UINT16 i = 0; // search for id - for (r2 = rover->target->ffloors; r2; r2 = r2->next); + for (r2 = rover->target->ffloors; r2; r2 = r2->next) { if (r2 == rover) break; diff --git a/src/p_spec.c b/src/p_spec.c index 2b02cc6ca..31203165d 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4753,7 +4753,7 @@ static inline ffloor_t *P_GetFFloorBySec(sector_t *sec, sector_t *sec2) /** Gets a 3Dfloor by ID number. * * \param sec Target sector. - * \param id ID of 3Dfloor in target sector. Can be a number from 0 to sec->numattached-1. + * \param id ID of 3Dfloor in target sector. Note that the first FOF's ID is 0. * \return Pointer to found 3Dfloor, or NULL. * \sa P_GetFFloorBySec */ @@ -4764,8 +4764,6 @@ ffloor_t *P_GetFFloorByID(sector_t *sec, UINT16 id) if (!sec->ffloors) return NULL; - if (id >= sec->numattached) - return NULL; // ID out of range for (rover = sec->ffloors; rover; rover = rover->next) if (i++ == id) return rover;