From 1b25024e1dce07a4afd4ac1c09081f385524a9ce Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Tue, 30 Oct 2018 16:56:30 +0100 Subject: [PATCH] - fix thing positioning --- src/lightmap/mapdata.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lightmap/mapdata.cpp b/src/lightmap/mapdata.cpp index 335e55c..69ea1ac 100644 --- a/src/lightmap/mapdata.cpp +++ b/src/lightmap/mapdata.cpp @@ -676,6 +676,9 @@ void FLevel::CreateLights() } } + int x = thing->x >> FRACBITS; + int y = thing->y >> FRACBITS; + thingLight = new thingLight_t; thingLight->mapThing = thing; @@ -685,10 +688,10 @@ void FLevel::CreateLights() thingLight->radius = lightDef->radius >= 0 ? lightDef->radius : thing->angle; thingLight->height = lightDef->height; thingLight->bCeiling = lightDef->bCeiling; - thingLight->ssect = PointInSubSector(thing->x, thing->y); + thingLight->ssect = PointInSubSector(x, y); thingLight->sector = GetSectorFromSubSector(thingLight->ssect); - thingLight->origin.Set(thing->x, thing->y); + thingLight->origin.Set(x, y); thingLights.Push(thingLight); }